From d2c077316919f625fab961747457dc9f6481a123 Mon Sep 17 00:00:00 2001 From: David Fry Date: Thu, 17 Jul 2025 13:59:27 +0100 Subject: [PATCH] feat: add configurable failurePolicy to webhookconfigurations (#9) --- charts/kubernetes-operator/templates/webhook.yaml | 10 +++++----- charts/kubernetes-operator/values.yaml | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/charts/kubernetes-operator/templates/webhook.yaml b/charts/kubernetes-operator/templates/webhook.yaml index 4ba96f3..3f55934 100644 --- a/charts/kubernetes-operator/templates/webhook.yaml +++ b/charts/kubernetes-operator/templates/webhook.yaml @@ -19,7 +19,7 @@ webhooks: name: {{ template "kubernetes-operator.webhookService" . }} namespace: {{ $.Release.Namespace }} path: /mutate--v1-pod - failurePolicy: Fail + failurePolicy: {{ .Values.webhook.failurePolicy }} name: mpod-v1.netbird.io admissionReviewVersions: - v1 @@ -71,7 +71,7 @@ webhooks: name: {{ template "kubernetes-operator.webhookService" . }} namespace: {{ $.Release.Namespace }} path: /validate-netbird-io-v1-nbsetupkey - failurePolicy: Fail + failurePolicy: {{ .Values.webhook.failurePolicy }} name: vnbsetupkey-v1.netbird.io admissionReviewVersions: - v1 @@ -112,7 +112,7 @@ webhooks: name: {{ template "kubernetes-operator.webhookService" . }} namespace: {{ $.Release.Namespace }} path: /validate-netbird-io-v1-nbresource - failurePolicy: Fail + failurePolicy: {{ .Values.webhook.failurePolicy }} name: vnbresource-v1.netbird.io admissionReviewVersions: - v1 @@ -151,7 +151,7 @@ webhooks: name: {{ template "kubernetes-operator.webhookService" . }} namespace: {{ $.Release.Namespace }} path: /validate-netbird-io-v1-nbroutingpeer - failurePolicy: Fail + failurePolicy: {{ .Values.webhook.failurePolicy }} name: vnbroutingpeer-v1.netbird.io admissionReviewVersions: - v1 @@ -190,7 +190,7 @@ webhooks: name: {{ template "kubernetes-operator.webhookService" . }} namespace: {{ $.Release.Namespace }} path: /validate-netbird-io-v1-nbgroup - failurePolicy: Fail + failurePolicy: {{ .Values.webhook.failurePolicy }} name: vnbgroup-v1.netbird.io admissionReviewVersions: - v1 diff --git a/charts/kubernetes-operator/values.yaml b/charts/kubernetes-operator/values.yaml index 3d0e332..6bcaa17 100644 --- a/charts/kubernetes-operator/values.yaml +++ b/charts/kubernetes-operator/values.yaml @@ -30,6 +30,9 @@ webhook: # operator: NotIn # values: # - foo + + # Failure Policy for webhook + failurePolicy: Fail operator: # This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/