This is an automated email from the ASF dual-hosted git repository.

squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit cef2e7a2d77080372254ba818787ed8f202b6f6e
Author: kartik <[email protected]>
AuthorDate: Wed Nov 18 16:18:56 2026 +1300

    Add custom values case to security-context e2e test
---
 e2e/common/traits/security_context_test.go | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/e2e/common/traits/security_context_test.go 
b/e2e/common/traits/security_context_test.go
index 87ebe9033..eed25dbf1 100644
--- a/e2e/common/traits/security_context_test.go
+++ b/e2e/common/traits/security_context_test.go
@@ -53,5 +53,20 @@ func TestSecurityContextTrait(t *testing.T) {
                        
g.Expect(pod.Spec.SecurityContext.SeccompProfile).NotTo(BeNil())
                        
g.Expect(pod.Spec.SecurityContext.SeccompProfile.Type).To(Equal(corev1.SeccompProfileTypeRuntimeDefault))
                })
+
+               t.Run("run with custom secuirty context", func(t *testing.T) {
+                       name := RandomizedSuffixName("java-sc-custom")
+                       g.Expect(KamelRun(t, ctx, ns, "files/Java.java", 
"--name", name, "-t", "security-context.run-as-user=2000", "-t", 
"security-context.seccomp-profile-type=Unconfined").Execute()).To(Succeed())
+                       g.Eventually(IntegrationPodPhase(t, ctx, ns, name), 
TestTimeoutLong).Should(Equal(corev1.PodRunning))
+                       g.Eventually(IntegrationConditionStatus(t, ctx, ns, 
name, v1.IntegrationConditionReady), 
TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+                       g.Eventually(IntegrationLogs(t, ctx, ns, name), 
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+
+                       pod := IntegrationPod(t, ctx, ns, name)()
+                       g.Expect(pod.Spec.SecurityContext).NotTo(BeNil())
+                       
g.Expect(pod.Spec.SecurityContext.RunAsUser).To(Equal(ptr.To[int64](2000)))
+                       
g.Expect(pod.Spec.SecurityContext.RunAsNonRoot).To(Equal(ptr.To[bool](true)))
+                       
g.Expect(pod.Spec.SecurityContext.SeccompProfile).NotTo(BeNil())
+                       
g.Expect(pod.Spec.SecurityContext.SeccompProfile.Type).To(Equal(corev1.SeccompProfileTypeUnconfined))
+               })
        })
 }

Reply via email to