Skip to content

Commit 3dd5004

Browse files
committed
[WIP] Update deployment test
1 parent 3e53047 commit 3dd5004

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

charts/test/unit/deployment_test.go

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,44 @@ func TestDeploymentServiceAccountName(t *testing.T) {
215215
assert.Equal(t, d, deployment)
216216
}
217217

218+
func TestDeploymentImagePullSecrets(t *testing.T) {
219+
options := &helm.Options{
220+
SetJsonValues: map[string]string{
221+
"imagePullSecrets": `[{"name": "this"}]`,
222+
},
223+
Version: helmChartVersion,
224+
}
225+
deployment := renderDeploymentManifest(t, options)
226+
d := defaultDeployment()
227+
d.Spec.Template.Spec.ImagePullSecrets = []corev1.LocalObjectReference{
228+
{
229+
Name: "this",
230+
},
231+
}
232+
233+
assert.Equal(t, d, deployment)
234+
}
235+
236+
func TestDeploymentPodLabels(t *testing.T) {
237+
options := &helm.Options{
238+
SetValues: map[string]string{
239+
"podLabels.this": "this",
240+
},
241+
Version: helmChartVersion,
242+
}
243+
deployment := renderDeploymentManifest(t, options)
244+
d := defaultDeployment()
245+
246+
labels := d.Spec.Template.DeepCopy().Labels
247+
labels["this"] = "this"
248+
d.Spec.Template.Labels = labels
249+
250+
assert.Equal(t, d, deployment)
251+
}
252+
218253
// TODO:
219254
// - customCAcertificates
220255
// - securityContext
221-
// - imagePullSecrets
222-
// - podLabels
223256
// - kubeRbacProxy.*
224257
// - operator.*
225258
// - controllers.*

0 commit comments

Comments
 (0)