Skip to content

Commit fcd86c1

Browse files
committed
[WIP] Update deployment test - operator
1 parent 99e0b7c commit fcd86c1

File tree

1 file changed

+55
-9
lines changed

1 file changed

+55
-9
lines changed

charts/test/unit/deployment_test.go

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,61 @@ func TestDeploymentOperatorSkipTLSVerify(t *testing.T) {
388388
assert.Equal(t, d, deployment)
389389
}
390390

391-
// KUBERBAC PROXY >>>
392-
// KUBERBAC PROXY <<<
391+
func TestDeploymentKubeRbacProxyImage(t *testing.T) {
392+
options := &helm.Options{
393+
Version: helmChartVersion,
394+
SetValues: map[string]string{
395+
"kubeRbacProxy.image.repository": "this",
396+
"kubeRbacProxy.image.pullPolicy": string(corev1.PullAlways),
397+
"kubeRbacProxy.image.tag": "0.0.1",
398+
},
399+
}
400+
deployment := renderDeploymentManifest(t, options)
401+
d := defaultDeployment()
402+
403+
d.Spec.Template.Spec.Containers[1].Image = "this:0.0.1"
404+
d.Spec.Template.Spec.Containers[1].ImagePullPolicy = corev1.PullAlways
405+
406+
assert.Equal(t, d, deployment)
407+
}
408+
409+
// TODO
410+
func TestDeploymentKubeRbacProxySecurityContext(t *testing.T) {
411+
options := &helm.Options{
412+
Version: helmChartVersion,
413+
SetValues: map[string]string{
414+
"kubeRbacProxy.image.repository": "this",
415+
"kubeRbacProxy.image.pullPolicy": string(corev1.PullAlways),
416+
"kubeRbacProxy.image.tag": "0.0.1",
417+
},
418+
}
419+
deployment := renderDeploymentManifest(t, options)
420+
d := defaultDeployment()
421+
422+
d.Spec.Template.Spec.Containers[1].Image = "this:0.0.1"
423+
d.Spec.Template.Spec.Containers[1].ImagePullPolicy = corev1.PullAlways
424+
425+
assert.Equal(t, d, deployment)
426+
}
427+
428+
// TODO
429+
func TestDeploymentKubeRbacProxyResources(t *testing.T) {
430+
options := &helm.Options{
431+
Version: helmChartVersion,
432+
SetValues: map[string]string{
433+
"kubeRbacProxy.image.repository": "this",
434+
"kubeRbacProxy.image.pullPolicy": string(corev1.PullAlways),
435+
"kubeRbacProxy.image.tag": "0.0.1",
436+
},
437+
}
438+
deployment := renderDeploymentManifest(t, options)
439+
d := defaultDeployment()
440+
441+
d.Spec.Template.Spec.Containers[1].Image = "this:0.0.1"
442+
d.Spec.Template.Spec.Containers[1].ImagePullPolicy = corev1.PullAlways
443+
444+
assert.Equal(t, d, deployment)
445+
}
393446

394447
func TestDeploymentControllers(t *testing.T) {
395448
options := &helm.Options{
@@ -472,10 +525,3 @@ func TestDeploymentServiceAccountName(t *testing.T) {
472525

473526
assert.Equal(t, d, deployment)
474527
}
475-
476-
// RBAC >>>
477-
// RBAC <<<
478-
479-
// TODO:
480-
// - kubeRbacProxy.*
481-
// - RBAC

0 commit comments

Comments
 (0)