From 39d18e5c0808ef5e039d72988808eb7389434445 Mon Sep 17 00:00:00 2001 From: Connor Catlett Date: Wed, 14 Feb 2024 20:54:36 +0000 Subject: [PATCH 1/3] Papercut[1]: Fix kops clusters becoming stuck when local KUBECONFIG is invalid Signed-off-by: Connor Catlett --- hack/e2e/kops/kops.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/e2e/kops/kops.sh b/hack/e2e/kops/kops.sh index 4f34c3580b..3dbc6d3bd8 100644 --- a/hack/e2e/kops/kops.sh +++ b/hack/e2e/kops/kops.sh @@ -119,7 +119,7 @@ function kops_patch_cluster_file() { jq "$FILTER" "$CLUSTER_FILE_JSON" >"$CLUSTER_FILE_0" # Patch only the json objects - kubectl patch -f "$CLUSTER_FILE_0" --local --type merge --patch "$(cat "$KOPS_PATCH_FILE")" -o json >"$CLUSTER_FILE_1" + kubectl patch --kubeconfig /dev/null -f "$CLUSTER_FILE_0" --local --type merge --patch "$(cat "$KOPS_PATCH_FILE")" -o json >"$CLUSTER_FILE_1" mv "$CLUSTER_FILE_1" "$CLUSTER_FILE_0" # Delete the original json objects, add the patched @@ -141,7 +141,7 @@ function kops_patch_cluster_file() { function yaml_to_json() { IN=${1} OUT=${2} - kubectl patch -f "$IN" --local -p "{}" --type merge -o json | jq '.' -s >"$OUT" + kubectl patch --kubeconfig /dev/null -f "$IN" --local -p "{}" --type merge -o json | jq '.' -s >"$OUT" } function json_to_yaml() { From e9b2a94b504f2050e584f3d2601e3f577e8fcf14 Mon Sep 17 00:00:00 2001 From: Connor Catlett Date: Wed, 14 Feb 2024 21:43:49 +0000 Subject: [PATCH 2/3] Papercut[2]: Restrain shfmt to hack/ directory Signed-off-by: Connor Catlett --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b366dc51de..e638d0d146 100644 --- a/Makefile +++ b/Makefile @@ -240,7 +240,7 @@ update/gomod: .PHONY: update/shfmt update/shfmt: bin/shfmt - ./bin/shfmt -w -i 2 -d . + ./bin/shfmt -w -i 2 -d ./hack/ ## Verifiers # Linters and similar From 70de213a39401e1c1b92ecc00f720b97c9a25e1f Mon Sep 17 00:00:00 2001 From: Connor Catlett Date: Wed, 14 Feb 2024 21:47:57 +0000 Subject: [PATCH 3/3] Papercut[3]: Attempt to delete Prow clusters that fail to create Signed-off-by: Connor Catlett --- hack/prow-e2e.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hack/prow-e2e.sh b/hack/prow-e2e.sh index 57a13b110b..7469a3e5f0 100755 --- a/hack/prow-e2e.sh +++ b/hack/prow-e2e.sh @@ -60,9 +60,12 @@ export KOPS_BUCKET=${KOPS_BUCKET:-"k8s-kops-csi-shared-e2e"} # Always use us-west-2 in CI, no matter where the local client is export AWS_REGION=us-west-2 -make cluster/create || exit 1 -make e2e/${TEST} -E2E_PASSED=$? +if make cluster/create; then + make e2e/${TEST} + E2E_PASSED=$? +else + E2E_PASSED=1 +fi make cluster/delete echo "E2E_PASSED: ${E2E_PASSED}"