Skip to content

Commit a487248

Browse files
committed
Set security context on test pod to avoid pod security warning
1 parent e10fae8 commit a487248

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/e2e/mnist_raycluster_sdk_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ func TestMNISTRayClusterSDK(t *testing.T) {
4141
test := With(t)
4242
test.T().Parallel()
4343

44+
// set security context for the pod
45+
allowPrivilegeEscalation := false
46+
runAsNonRoot := true
47+
4448
// Currently blocked by https://github.com/project-codeflare/codeflare-sdk/pull/251 , remove the skip once SDK with the PR is released
4549
test.T().Skip("Requires https://github.com/project-codeflare/codeflare-sdk/pull/251")
4650

@@ -176,6 +180,16 @@ func TestMNISTRayClusterSDK(t *testing.T) {
176180
},
177181
},
178182
WorkingDir: "/workdir",
183+
SecurityContext: &corev1.SecurityContext{
184+
AllowPrivilegeEscalation: &allowPrivilegeEscalation,
185+
SeccompProfile: &corev1.SeccompProfile{
186+
Type: "RuntimeDefault",
187+
},
188+
Capabilities: &corev1.Capabilities{
189+
Drop: []corev1.Capability{"ALL"},
190+
},
191+
RunAsNonRoot: &runAsNonRoot,
192+
},
179193
},
180194
},
181195
Volumes: []corev1.Volume{

0 commit comments

Comments
 (0)