Skip to content

Commit

Permalink
Add new kuttl test on ValidatingWebhookConfiguration to make sure it …
Browse files Browse the repository at this point in the history
…lands in the right namespace.

Add documentation comments to user-defined-ns test to explain what each step is doing w.r.t. namespacing.
  • Loading branch information
Miles-Garnsey committed Feb 15, 2022
1 parent 3bff9b3 commit a147a90
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
18 changes: 17 additions & 1 deletion test/kuttl/test-user-defined-ns/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,20 @@ status:
- reason: NewReplicaSetAvailable
status: "True"
type: Progressing
readyReplicas: 1
readyReplicas: 1
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: k8ssandra-operator/cass-operator-serving-cert
name: cass-operator-validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: cass-operator-webhook-service
namespace: k8ssandra-operator
path: /validate-cassandra-datastax-com-v1beta1-cassandradatacenter
4 changes: 3 additions & 1 deletion test/kuttl/test-user-defined-ns/01-k8ssandra-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# We are deploying a cluster scoped version of cass-operator and k8ssandra-operator into the namespace k8ssandra-operator.
# This sets us up to ensure the cluster-scope component is successful, and immediately demonstrates that the single-namespace component is sucessful.
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
../../../bin/kustomize build ../../../config/deployments/control-plane/cluster-scope | kubectl apply --server-side --force-conflicts -f -
ignoreFailure: false
ignoreFailure: false
1 change: 1 addition & 0 deletions test/kuttl/test-user-defined-ns/02-k8ssandra-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# While all operators are in k8ssandra-operator ns, the K8ssandraCluster is in test-ns. This demonstrates that cluster scoping is successful.
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
Expand Down

0 comments on commit a147a90

Please sign in to comment.