From 580a1456828e8c24c718c8631ecc7a4e130f8317 Mon Sep 17 00:00:00 2001 From: Samuele Chiocca Date: Fri, 10 Nov 2023 14:59:02 +0100 Subject: [PATCH] feat: update tests scripts, add loop it also on gatekeeper first apply --- katalog/tests/gatekeeper.sh | 45 +------------------------------------ katalog/tests/helper.bash | 2 +- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/katalog/tests/gatekeeper.sh b/katalog/tests/gatekeeper.sh index 09f8123..99c7482 100755 --- a/katalog/tests/gatekeeper.sh +++ b/katalog/tests/gatekeeper.sh @@ -26,7 +26,7 @@ set -o pipefail kubectl apply -f https://raw.githubusercontent.com/sighupio/fury-kubernetes-monitoring/v1.14.2/katalog/prometheus-operator/crd-rule.yml force_apply katalog/gatekeeper/core } - run deploy + loop_it deploy 30 2 [[ "$status" -eq 0 ]] } @@ -265,46 +265,3 @@ set -o pipefail [[ "$status" -eq 0 ]] [[ "$output" -eq 3 ]] } - -@test "Teardown - Delete resources" { - info - skip - resource_teardown() { - kubectl delete -f katalog/tests/gatekeeper-manifests/deploy_ns_whitelisted.yml - kubectl delete -f katalog/tests/gatekeeper-manifests/deployment_trusted.yml - kubectl delete -f katalog/tests/gatekeeper-manifests/ingress_trusted.yml - kubectl delete pod bad-pod - } - run resource_teardown - [[ "$status" -eq 0 ]] -} - -@test "Teardown - Delete Mutator" { - info - skip - mutator_teardown() { - kubectl delete -f katalog/tests/gatekeeper-manifests/mutation.yaml - } - run mutator_teardown - [[ "$status" -eq 0 ]] -} - -@test "Teardown - Delete Gatekeeper Rules" { - info - skip - gatekeeper_teardown() { - kaction katalog/gatekeeper/rules delete - } - run gatekeeper_teardown - [[ "$status" -eq 0 ]] -} - -@test "Teardown - Delete Gatekeeper Core" { - info - skip - gatekeeper_teardown() { - kaction katalog/gatekeeper/core delete - } - run gatekeeper_teardown - [[ "$status" -eq 0 ]] -} diff --git a/katalog/tests/helper.bash b/katalog/tests/helper.bash index 6e9360e..ebf7d32 100644 --- a/katalog/tests/helper.bash +++ b/katalog/tests/helper.bash @@ -7,7 +7,7 @@ set -o pipefail kaction(){ path=$1 verb=$2 - kustomize build $path | kubectl $verb -f - 2>&3 + kustomize build $path | kubectl $verb -f - --server-side 2>&3 } apply (){