diff --git a/pkg/webhook/patch.go b/pkg/webhook/patch.go index 4a54a0ce9..20fce1606 100644 --- a/pkg/webhook/patch.go +++ b/pkg/webhook/patch.go @@ -73,12 +73,11 @@ func patchSparkPod(pod *corev1.Pod, app *v1beta1.SparkApplication) []patchOperat } } - if pod.Spec.SecurityContext == nil { - op := addSecurityContext(pod, app) - if op != nil { - patchOps = append(patchOps, *op) - } + op = addSecurityContext(pod, app) + if op != nil { + patchOps = append(patchOps, *op) } + op = addGPU(pod, app) if op != nil { patchOps = append(patchOps, *op)