kartikgoel598 opened a new pull request, #6986: URL: https://github.com/apache/camel-k/pull/6986
Closes #6963 Adds e2e/common/traits/security_context_test.go, following the pattern in toleration_test.go. It runs in the common workflow, as agreed on the issue. The test has three cases: 1. Default security context: with no trait options, the pod gets runAsUser 1000, runAsNonRoot true and seccomp RuntimeDefault, and the Integration starts normally. 2. Custom values: with run-as-user=2000 and seccomp-profile-type=Unconfined, the pod gets those values, runAsNonRoot stays true, and the Integration starts normally. 3. Root is blocked: with run-as-user=0 and run-as-non-root=true, the kubelet refuses to start the container, and the test waits for the CreateContainerConfigError waiting reason. This checks that the setting really affects the runtime, not just the pod spec. Note on case 3: the container trait sets a container-level runAsNonRoot of false by default, which overrides the pod-level value from the security-context trait. As discussed on #6963, this case adds -t container.run-as-non-root=true for now, with a TODO pointing to #XXXX, which tracks changing that default to true. Testing: ran the common workflow on my fork; all three cases pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
