From 8bc5df4c43172f2d3ee6f56990ed414e6f90a3bc Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Wed, 1 Sep 2021 17:13:49 +0300 Subject: [PATCH] Add staged apply e2e test (cert-manager) Signed-off-by: Stefan Prodan --- .github/workflows/e2e.yaml | 10 +++++---- testdata/certs/cert.yaml | 37 +++++++++++++++++++++++++++++++ testdata/certs/kustomization.yaml | 5 +++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 testdata/certs/cert.yaml create mode 100644 testdata/certs/kustomization.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 1ca291d..ded3c4d 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -59,13 +59,15 @@ jobs: kubectl get crd tests.testing.kustomizer.dev 2>&1 | grep NotFound - name: Load test apply (110 objects) run: | - time ./bin/kustomizer apply -k ./testdata/loadtest/ --inventory-name load-test + ./bin/kustomizer apply -k ./testdata/loadtest/ --inventory-name load-test - name: Load test delete (110 objects) run: | - time ./bin/kustomizer delete --inventory-name load-test + ./bin/kustomizer delete --inventory-name load-test + - name: Test staged apply + run: | + ./bin/kustomizer apply -k ./testdata/certs/ --prune --wait --inventory-name cert-test --mode=ApplyAllStaged + kubectl -n kustomizer-cert-test wait issuers/my-ca-issuer --for=condition=ready --timeout=1m - name: Debug failure if: failure() run: | - kubectl version --client --short kubectl -n default get configmaps -oyaml - kubectl -n kustomizer-demo get all diff --git a/testdata/certs/cert.yaml b/testdata/certs/cert.yaml new file mode 100644 index 0000000..b311011 --- /dev/null +++ b/testdata/certs/cert.yaml @@ -0,0 +1,37 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: kustomizer-cert-test +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: selfsigned-issuer +spec: + selfSigned: {} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: my-selfsigned-ca + namespace: kustomizer-cert-test +spec: + isCA: true + commonName: my-selfsigned-ca + secretName: root-secret + privateKey: + algorithm: ECDSA + size: 384 + issuerRef: + name: selfsigned-issuer + kind: ClusterIssuer + group: cert-manager.io +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: my-ca-issuer + namespace: kustomizer-cert-test +spec: + ca: + secretName: root-secret diff --git a/testdata/certs/kustomization.yaml b/testdata/certs/kustomization.yaml new file mode 100644 index 0000000..f72285a --- /dev/null +++ b/testdata/certs/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- https://github.com/jetstack/cert-manager/releases/download/v1.5.3/cert-manager.yaml +- cert.yaml