Skip to content

Avoid PodSecurity warning when running TestMNISTRayClusterSDK on OpenShift #328

Closed
@astefanutti

Description

@astefanutti

Some warnings are reported when running the TestMNISTRayClusterSDK test on OpenShift:

TestMNISTRayClusterSDK
    mnist_raycluster_sdk_test.go:70: Created ConfigMap test-ns-mdmdq/mnist-raycluster-sdk successfully
W1011 14:41:01.398608   41981 warnings.go:70] would violate PodSecurity "restricted:v1.24": allowPrivilegeEscalation != false (container "test" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "test" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "test" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "test" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
    mnist_raycluster_sdk_test.go:205: Created Job test-ns-mdmdq/sdk successfully

It should be possible to remove the warning by setting the required security context on the test Pod, e.g.:

spec:
  containers:
  - securityContext:
      allowPrivilegeEscalation: false
      seccompProfile:
        type: RuntimeDefault
      capabilities:
        drop:
        - ALL

Metadata

Metadata

Assignees

Labels

testingItems related to testing

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions