Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force k8s object removal in e2e cleanup #212

Merged
merged 2 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions test/e2e/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ cleanup_fission() {

emph "Removing custom resources..."
clean_tpr_crd_resources || true
kubectl delete all --all -n ${NS}
kubectl delete all --all -n ${NS_FUNCTION}
kubectl delete all --all -n ${NS_BUILDER}
kubectl delete all --force --now --all -n ${NS}
kubectl delete all --force --now --all -n ${NS_FUNCTION}
kubectl delete all --force --now --all -n ${NS_BUILDER}


# Trigger deletion of all namespaces before waiting - for concurrency of deletion
emph "Forcing deletion of namespaces..."
kubectl delete ns/${NS} --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_BUILDER} --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_FUNCTION} --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS} --force --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_BUILDER} --force --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_FUNCTION} --force --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete

# Wait until all namespaces are actually deleted!
emph "Awaiting deletion of namespaces..."
verify_ns_deleted() {
kubectl delete ns/${1} --now 2>&1 | grep -qv "Error from server (Conflict):"
kubectl delete ns/${1} --force --now 2>&1 | grep -qv "Error from server (Conflict):"
}
# Namespaces sometimes take a long time to delete for some reason
sleep 10
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/tests/test_inputs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail
set -exuo pipefail

EXAMPLE_DIR=$(dirname $0)/../../../examples/misc

Expand All @@ -9,7 +9,6 @@ cleanup() {
}
trap cleanup EXIT

fission env create --name binary --image fission/binary-env:latest || true
fission fn create --name inputs --env workflow --src ${EXAMPLE_DIR}/inputs.wf.yaml
sleep 5 # TODO remove this once we can initiate synchronous commands
fission fn test --name inputs -b 'foobar' -H 'HEADER_KEY: HEADER_VAL' --method PUT \
Expand Down