Skip to content

Commit

Permalink
fix: namespace pathch no effect
Browse files Browse the repository at this point in the history
Signed-off-by: acejilam <[email protected]>
  • Loading branch information
ls-2018 committed Aug 22, 2024
1 parent a543ad0 commit 973ac69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/webhook/mutating.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ func (a *MutatingAdmission) Handle(ctx context.Context, req admission.Request) a

klog.V(6).InfoS("override obj", "obj", buf.String())
}

if newObj.GetNamespace() == "" && req.Namespace != "" {
newObj.SetNamespace(req.Namespace)
}
cops, ops, err := a.overrideManager.ApplyOverridePolicies(utils.ContextWithTrace(ctx, trace), newObj, oldObj, req.Operation)
if err != nil {
return admission.Errored(http.StatusInternalServerError, err)
Expand Down

0 comments on commit 973ac69

Please sign in to comment.