Skip to content

Commit b4e019f

Browse files
committed
UPSTREAM: <carry>: pod-security: don't fail on SCC admission error
If we propagate SCC admission error during pod extraction to PodSecurity admission, the latter will log the error instead of continuing with unmutated pod spec, and so we will not get a validation error in either the audit logs or as a warning.
1 parent 099791b commit b4e019f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: plugin/pkg/admission/security/podsecurity/patch_podspecextractor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (s *SCCMutatingPodSpecExtractor) ExtractPodSpec(obj runtime.Object) (*metav
9696
klog.ErrorS(err, "failed to mutate object for PSA using SCC")
9797
utilruntime.HandleError(fmt.Errorf("failed to mutate object for PSA using SCC: %w", err))
9898
// TODO remove this failure we're causing when SCC fails, but for now we actually need to see our test fail because that was almost really bad.
99-
return podTemplateMeta, originalPodSpec, err
99+
return podTemplateMeta, originalPodSpec, nil
100100
}
101101

102102
if err := v1.Convert_core_Pod_To_v1_Pod(internalPod, pod, nil); err != nil {

0 commit comments

Comments
 (0)