From df8b3a750f57a03fbedc792218b67ed937893291 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Sat, 17 Jul 2021 15:46:00 -0700 Subject: [PATCH] Fix kops binary references in keypair rotation scenario --- .../scenarios/keypair-rotation/run-test.sh | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/e2e/scenarios/keypair-rotation/run-test.sh b/tests/e2e/scenarios/keypair-rotation/run-test.sh index 2649ec5faf..326cbfc1ca 100755 --- a/tests/e2e/scenarios/keypair-rotation/run-test.sh +++ b/tests/e2e/scenarios/keypair-rotation/run-test.sh @@ -17,30 +17,30 @@ REPO_ROOT=$(git rev-parse --show-toplevel); source "${REPO_ROOT}"/tests/e2e/scenarios/lib/common.sh -kops-acquire-latest +KOPS=$(kops-acquire-latest) kops-up REPORT_DIR="${ARTIFACTS:-$(pwd)/_artifacts}/keypair-rotation/" -kops create keypair all -kops update cluster --yes -kops rolling-update cluster --yes --validate-count=10 +${KOPS} create keypair all +${KOPS} update cluster --yes +${KOPS} rolling-update cluster --yes --validate-count=10 KUBECFG_CREATE=$(mktemp -t kubeconfig.XXXXXXXXX) -kops export kubecfg --admin --kubeconfig="${KUBECFG_CREATE}" +${KOPS} export kubecfg --admin --kubeconfig="${KUBECFG_CREATE}" kubectl --kubeconfig="${KUBECFG_CREATE}" config view > "${REPORT_DIR}/create.kubeconfig" # Confirm the first kubeconfig still works -kops validate cluster --wait=10m --count=3 +${KOPS} validate cluster --wait=10m --count=3 export KUBECONFIG="${KUBECFG_CREATE}" -kops promote keypair all -kops update cluster --yes -kops rolling-update cluster --yes --validate-count=10 +${KOPS} promote keypair all +${KOPS} update cluster --yes +${KOPS} rolling-update cluster --yes --validate-count=10 KUBECFG_PROMOTE=$(mktemp -t kubeconfig.XXXXXXXXX) -kops export kubecfg --admin --kubeconfig="${KUBECFG_PROMOTE}" +${KOPS} export kubecfg --admin --kubeconfig="${KUBECFG_PROMOTE}" kubectl --kubeconfig="${KUBECFG_PROMOTE}" config view > "${REPORT_DIR}/promote.kubeconfig" CA=$(kubectl --kubeconfig="${KUBECFG_PROMOTE}" config view --raw -o jsonpath="{.clusters[0].cluster.certificate-authority-data}" | base64 -D) @@ -50,13 +50,13 @@ if [ "$(echo "${CA}" | grep -c "BEGIN CERTIFICATE")" != "1" ]; then fi export KUBECONFIG="${KUBECFG_PROMOTE}" -kops distrust keypair all -kops update cluster --yes -kops rolling-update cluster --yes --validate-count=10 +${KOPS} distrust keypair all +${KOPS} update cluster --yes +${KOPS} rolling-update cluster --yes --validate-count=10 KUBECFG_DISTRUST=$(mktemp -t kubeconfig.XXXXXXXXX) -kops export kubecfg --admin --kubeconfig="${KUBECFG_DISTRUST}" +${KOPS} export kubecfg --admin --kubeconfig="${KUBECFG_DISTRUST}" kubectl --kubeconfig="${KUBECFG_DISTRUST}" config view > "${REPORT_DIR}/distrust.kubeconfig" export KUBECONFIG="${KUBECFG_DISTRUST}" -kops validate cluster --wait=10m --count=3 +${KOPS} validate cluster --wait=10m --count=3