Skip to content

Instantly share code, notes, and snippets.

@ncdc
Created January 14, 2020 17:03
Show Gist options
  • Save ncdc/8fab7301df59cee603a3f74da02a7b36 to your computer and use it in GitHub Desktop.
Save ncdc/8fab7301df59cee603a3f74da02a7b36 to your computer and use it in GitHub Desktop.
diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml
index 9cf2613..1dcdbda 100644
--- a/config/webhook/kustomization.yaml
+++ b/config/webhook/kustomization.yaml
@@ -4,3 +4,6 @@ resources:
configurations:
- kustomizeconfig.yaml
+
+patchesStrategicMerge:
+- namespaceselector.yaml
diff --git a/config/webhook/namespaceselector.yaml b/config/webhook/namespaceselector.yaml
new file mode 100644
index 0000000..ad71988
--- /dev/null
+++ b/config/webhook/namespaceselector.yaml
@@ -0,0 +1,12 @@
+apiVersion: admissionregistration.k8s.io/v1beta1
+kind: MutatingWebhookConfiguration
+metadata:
+ name: mutating-webhook-configuration
+webhooks:
+ - name: image-mapper.imagerelocation.pivotal.io
+ namespaceSelector:
+ matchExpressions:
+ - key: image-relocating-webhook.image-relocation.pivotal.io/enabled
+ operator: NotIn
+ values:
+ - "false"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment