Skip to content

Commit b9b619d

Browse files
beeme1mrtoddbaert
andauthored
fix: use webhook ns if empty, more test versions (#568)
Signed-off-by: Michael Beemer <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 4c0fe34 commit b9b619d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
needs: docker-local
9999
strategy:
100100
matrix:
101-
node_image: [ v1.25.0, v1.26.0, v1.27.0 ]
101+
node_image: [ v1.22.17, v1.23.17, v1.24.15, v1.25.11, v1.26.3, v1.27.3, v1.28.0 ]
102102
steps:
103103
- name: Install Go
104104
uses: actions/setup-go@v4

webhooks/pod_webhook.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ func (m *PodMutator) Handle(ctx context.Context, req admission.Request) admissio
5151
}()
5252
pod := &corev1.Pod{}
5353
err := m.decoder.Decode(req, pod)
54+
55+
// Fixes an issue with admission webhook on older k8s versions
56+
// See: https://github.com/open-feature/open-feature-operator/issues/500
57+
if pod.Namespace == "" {
58+
pod.Namespace = req.Namespace
59+
}
60+
5461
if err != nil {
5562
return admission.Errored(http.StatusBadRequest, err)
5663
}

0 commit comments

Comments
 (0)