Skip to content

Commit

Permalink
feat: update tests scripts, add loop it also on gatekeeper first apply
Browse files Browse the repository at this point in the history
  • Loading branch information
nutellinoit committed Nov 10, 2023
1 parent 3475d94 commit 580a145
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 45 deletions.
45 changes: 1 addition & 44 deletions katalog/tests/gatekeeper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]]
}

Expand Down Expand Up @@ -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 ]]
}
2 changes: 1 addition & 1 deletion katalog/tests/helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 (){
Expand Down

0 comments on commit 580a145

Please sign in to comment.