Skip to content

Commit

Permalink
fix: use webhook ns if empty, more test versions (#568)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: Todd Baert <toddbaert@gmail.com>
Co-authored-by: Todd Baert <toddbaert@gmail.com>
  • Loading branch information
beeme1mr and toddbaert authored Dec 1, 2023
1 parent 4c0fe34 commit b9b619d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
needs: docker-local
strategy:
matrix:
node_image: [ v1.25.0, v1.26.0, v1.27.0 ]
node_image: [ v1.22.17, v1.23.17, v1.24.15, v1.25.11, v1.26.3, v1.27.3, v1.28.0 ]
steps:
- name: Install Go
uses: actions/setup-go@v4
Expand Down
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

0 comments on commit b9b619d

Please sign in to comment.