Skip to content

Commit

Permalink
Add validation webhook for Namespace deletion (#326)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha authored Oct 3, 2018
1 parent f94b14e commit 6c8c232
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions chart/kubedb/templates/validating-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,17 @@ webhooks:
resources: ["dormantdatabases"]
operations: ["CREATE", "UPDATE", "DELETE"]
failurePolicy: Fail
- name: namespaces.validators.kubedb.com
clientConfig:
service:
namespace: default
name: kubernetes
path: /apis/validators.kubedb.com/v1alpha1/namespaces
caBundle: {{ b64enc .Values.apiserver.ca }}
rules:
- apiGroups: [""]
apiVersions: ["*"]
resources: ["namespaces"]
operations: ["DELETE"]
failurePolicy: Fail
{{ end }}
13 changes: 13 additions & 0 deletions hack/deploy/validating-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,16 @@ webhooks:
resources: ["dormantdatabases"]
operations: ["CREATE", "UPDATE", "DELETE"]
failurePolicy: Fail
- name: namespaces.validators.kubedb.com
clientConfig:
service:
namespace: default
name: kubernetes
path: /apis/validators.kubedb.com/v1alpha1/namespaces
caBundle: ${KUBE_CA}
rules:
- apiGroups: [""]
apiVersions: ["*"]
resources: ["namespaces"]
operations: ["DELETE"]
failurePolicy: Fail

0 comments on commit 6c8c232

Please sign in to comment.