diff --git a/webhooks/pod_webhook.go b/webhooks/pod_webhook.go index 2031d5d40..4869e34ce 100644 --- a/webhooks/pod_webhook.go +++ b/webhooks/pod_webhook.go @@ -65,6 +65,11 @@ func (m *PodMutator) Handle(ctx context.Context, req admission.Request) admissio }() pod := &corev1.Pod{} err := m.decoder.Decode(req, pod) + + if pod.Namespace == "" { + pod.Namespace = req.Namespace + } + if err != nil { return admission.Errored(http.StatusBadRequest, err) }