From 0f78ce6ed5579f7f8a23604e144f5643ee6c1fb5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 2 Nov 2018 18:01:58 -0700 Subject: [PATCH] cluster-launch-installer-e2e: Block tests on 'create cluster' Don't run the tests before 'create cluster' exits successfully (if it fails, the /tmp/shared/exit check will kill the 'test' container). With this, we no longer have to wait on the shared kubeconfig, because we know it was created before setup-success. And once 'create cluster' successfully blocks on the bootstrap-complete event [1], this commit will ensure that we run our tests on the production control plane, and while the bootstrap control plane is still involved. [1]: https://github.com/openshift/installer/pull/579 Although we've been seeing some issues with the re-watch logic from that pull request. Once that logic solidifies, we can drop the API_UP check as well. --- .../installer/cluster-launch-installer-e2e.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml index faeeabdb7cf19..0c37ac0101a8c 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml @@ -99,7 +99,7 @@ objects: mkdir -p "${HOME}" # wait for the router namespace - FOUND_KUBECONFIG= + SETUP_SUCCESS= API_UP= ROUTER_NAMESPACE= ROUTER_DEPLOYMENT= @@ -108,12 +108,12 @@ objects: echo "Another process exited" 2>&1 exit 1 fi - if [[ ! -f "${KUBECONFIG}" ]]; then + if [[ ! -f /tmp/shared/setup-success ]]; then sleep 15 & wait continue - elif [[ -z "${FOUND_KUBECONFIG}" ]]; then - echo "Found shared kubeconfig" - FOUND_KUBECONFIG=1 + elif [[ -z "${SETUP_SUCCESS}" ]]; then + echo "Setup success" + SETUP_SUCCESS=1 # don't let clients impact the global kubeconfig cp "${KUBECONFIG}" /tmp/admin.kubeconfig @@ -265,7 +265,7 @@ objects: - -c - | #!/bin/sh - trap 'rc=$?; if test "${rc}" -ne 0; then touch /tmp/exit; fi; exit "${rc}"' EXIT + trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN}; fi' TERM mkdir /tmp/artifacts/installer &&