From 833ba5cac5413744a7fab38f1cfd4b3d4fd668bd Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Mon, 4 Nov 2024 19:03:15 +0800 Subject: [PATCH] Fix: executor container security context does not work (#2306) Signed-off-by: Yi Chen (cherry picked from commit 171e429706214645611f6921e31db8652d921219) --- internal/webhook/sparkpod_defaulter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/webhook/sparkpod_defaulter.go b/internal/webhook/sparkpod_defaulter.go index add324b196..53e717ff32 100644 --- a/internal/webhook/sparkpod_defaulter.go +++ b/internal/webhook/sparkpod_defaulter.go @@ -537,7 +537,7 @@ func addContainerSecurityContext(pod *corev1.Pod, app *v1beta2.SparkApplication) if i < 0 { return fmt.Errorf("executor container not found in pod") } - if app.Spec.Driver.SecurityContext == nil { + if app.Spec.Executor.SecurityContext == nil { return nil } pod.Spec.Containers[i].SecurityContext = app.Spec.Executor.SecurityContext