Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use webhook ns if empty, more test versions #568

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions webhooks/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ func (m *PodMutator) Handle(ctx context.Context, req admission.Request) admissio
}()
pod := &corev1.Pod{}
err := m.decoder.Decode(req, pod)

// Fixes an issue with admission webhook on older k8s versions
// See: https://github.com/open-feature/open-feature-operator/issues/500
if pod.Namespace == "" {
pod.Namespace = req.Namespace
}

if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
Expand Down
Loading