From bf79c25a8a7fed158575fe7d5abd6358b8049fdb Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Tue, 8 Jun 2021 18:32:17 +0200 Subject: [PATCH] build(kustomize): webhook for image PullPolicy --- config/manager/kustomization.yaml | 2 +- config/webhook/manifests.yaml | 19 +++++++++++++++++++ config/webhook/patch_ns_selector.yaml | 8 +++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 39dcd4b7..c650d359 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -7,4 +7,4 @@ kind: Kustomization images: - name: controller newName: quay.io/clastix/capsule - newTag: v0.0.5 + newTag: v0.1.0-rc1 diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 88c30fd3..46586944 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -33,6 +33,25 @@ metadata: creationTimestamp: null name: validating-webhook-configuration webhooks: +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /validating-imagepullpolicy + failurePolicy: Fail + name: validating-image-pull-policy.capsule.clastix.io + rules: + - apiGroups: + - "" + apiVersions: + - v1 + operations: + - CREATE + resources: + - pods + sideEffects: None - admissionReviewVersions: - v1 clientConfig: diff --git a/config/webhook/patch_ns_selector.yaml b/config/webhook/patch_ns_selector.yaml index 64bfe387..d5312b2e 100644 --- a/config/webhook/patch_ns_selector.yaml +++ b/config/webhook/patch_ns_selector.yaml @@ -11,7 +11,7 @@ - key: capsule.clastix.io/tenant operator: Exists - op: add - path: /webhooks/3/namespaceSelector + path: /webhooks/2/namespaceSelector value: matchExpressions: - key: capsule.clastix.io/tenant @@ -40,3 +40,9 @@ matchExpressions: - key: capsule.clastix.io/tenant operator: Exists +- op: add + path: /webhooks/8/namespaceSelector + value: + matchExpressions: + - key: capsule.clastix.io/tenant + operator: Exists