Skip to content

Commit 0dc1639

Browse files
committed
[WIP] Update deployment test - security context
1 parent 3dd5004 commit 0dc1639

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

charts/test/unit/deployment_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,21 @@ func TestDeploymentPodLabels(t *testing.T) {
250250
assert.Equal(t, d, deployment)
251251
}
252252

253+
func TestDeploymentSecurityContext(t *testing.T) {
254+
options := &helm.Options{
255+
Version: helmChartVersion,
256+
SetValues: map[string]string{
257+
"securityContext.runAsNonRoot": "false",
258+
},
259+
}
260+
deployment := renderDeploymentManifest(t, options)
261+
d := defaultDeployment()
262+
263+
d.Spec.Template.Spec.SecurityContext.RunAsNonRoot = ptr.To(false)
264+
265+
assert.Equal(t, d, deployment)
266+
}
267+
253268
// TODO:
254269
// - customCAcertificates
255270
// - securityContext

0 commit comments

Comments
 (0)