From f60a1f8d0cd6b3aa2fea41eb1afb3fa8f9320295 Mon Sep 17 00:00:00 2001 From: ted chang Date: Thu, 19 Oct 2023 13:31:15 -0700 Subject: [PATCH] pull image from quay.io --- hack/run-e2e-kind.sh | 78 ++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 4c18b473..0c6c8a8f 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -31,7 +31,7 @@ export LOG_LEVEL=${TEST_LOG_LEVEL:-2} export CLEANUP_CLUSTER=${CLEANUP_CLUSTER:-"true"} export CLUSTER_CONTEXT="--name test" # Using older image due to older version of kubernetes cluster" -export IMAGE_ECHOSERVER="kicbase/echo-server:1.0" +export IMAGE_ECHOSERVER="quay.io/project-codeflare/echo-server:1.0" export IMAGE_UBUNTU_LATEST="ubuntu:latest" export IMAGE_UBI_LATEST="registry.access.redhat.com/ubi8/ubi:latest" export IMAGE_BUSY_BOX_LATEST="k8s.gcr.io/busybox:latest" @@ -49,7 +49,7 @@ export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/k DUMP_LOGS="true" function update_test_host { - + local arch="$(go env GOARCH)" if [ -z $arch ] then @@ -67,43 +67,43 @@ function update_test_host { which kubectl >/dev/null 2>&1 if [ $? -ne 0 ] - then + then sudo apt-get install -y --allow-unauthenticated kubectl - [ $? -ne 0 ] && echo "Failed to install kubectl" && exit 1 - echo "kubectl was sucessfully installed." - fi - + [ $? -ne 0 ] && echo "Failed to install kubectl" && exit 1 + echo "kubectl was sucessfully installed." + fi + which kind >/dev/null 2>&1 - if [ $? -ne 0 ] + if [ $? -ne 0 ] then # Download kind binary (0.20.0) echo "Downloading and installing kind...." sudo curl -o /usr/local/bin/kind -L https://github.com/kubernetes-sigs/kind/releases/download/v0.20.0/kind-linux-${arch} && \ - sudo chmod +x /usr/local/bin/kind - [ $? -ne 0 ] && echo "Failed to download kind" && exit 1 - echo "Kind was sucessfully installed." + sudo chmod +x /usr/local/bin/kind + [ $? -ne 0 ] && echo "Failed to download kind" && exit 1 + echo "Kind was sucessfully installed." fi which helm >/dev/null 2>&1 if [ $? -ne 0 ] - then + then # Installing helm3 echo "Downloading and installing helm..." - curl -fsSL -o ${ROOT_DIR}/get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && + curl -fsSL -o ${ROOT_DIR}/get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 ${ROOT_DIR}/get_helm.sh && ${ROOT_DIR}/get_helm.sh [ $? -ne 0 ] && echo "Failed to download and install helm" && exit 1 echo "Helm was sucessfully installed." rm -rf ${ROOT_DIR}/get_helm.sh fi - + kubectl kuttl version >/dev/null 2>&1 if [ $? -ne 0 ] then if [[ "$arch" == "amd64" ]] - then + then local kuttl_arch="x86_64" else - local kuttl_arch=$arch + local kuttl_arch=$arch fi # Download kuttl plugin echo "Downloading and installing kuttl...." @@ -119,7 +119,7 @@ function update_test_host { function check-prerequisites { echo "checking prerequisites" which kind >/dev/null 2>&1 - if [ $? -ne 0 ] + if [ $? -ne 0 ] then echo "kind not installed, exiting." exit 1 @@ -133,7 +133,7 @@ function check-prerequisites { echo "kubectl not installed, exiting." exit 1 else - echo -n "found kubectl, " && kubectl version + echo -n "found kubectl, " && kubectl version fi kubectl kuttl version >/dev/null 2>&1 if [ $? -ne 0 ] @@ -143,7 +143,7 @@ function check-prerequisites { else echo -n "found kuttl plugin for kubectl, " && kubectl kuttl version fi - + if [[ $IMAGE_REPOSITORY_MCAD == "" ]] then echo "No MCAD image was provided." @@ -155,7 +155,7 @@ function check-prerequisites { else echo "end to end test with ${IMAGE_MCAD}." fi - + which helm >/dev/null 2>&1 if [ $? -ne 0 ] then @@ -163,9 +163,9 @@ function check-prerequisites { exit 1 else echo -n "found helm, " && helm version --short - fi + fi + - which helm >/dev/null 2>&1 if [ $? -ne 0 ] then @@ -173,7 +173,7 @@ function check-prerequisites { exit 1 else echo -n "found helm, " && helm version --short - fi + fi } @@ -193,7 +193,7 @@ function kind-up-cluster { fi CLUSTER_STARTED="true" - docker pull ${IMAGE_ECHOSERVER} + docker pull ${IMAGE_ECHOSERVER} if [ $? -ne 0 ] then echo "Failed to pull ${IMAGE_ECHOSERVER}" @@ -213,14 +213,14 @@ function kind-up-cluster { echo "Failed to pull ${IMAGE_UBI_LATEST}" exit 1 fi - + docker pull ${IMAGE_BUSY_BOX_LATEST} if [ $? -ne 0 ] then echo "Failed to pull ${IMAGE_BUSY_BOX_LATEST}" exit 1 fi - + if [[ "$MCAD_IMAGE_PULL_POLICY" = "Always" ]] then docker pull ${IMAGE_MCAD} @@ -245,7 +245,7 @@ function kind-up-cluster { echo "Failed to load image ${image} in cluster" exit 1 fi - done + done } # clean up @@ -256,7 +256,7 @@ function cleanup { then echo "Cluster was not started, nothing more to do." return - fi + fi if [[ ${DUMP_LOGS} == "true" ]] then @@ -303,15 +303,15 @@ function cleanup { kubectl logs ${mcad_pod} -n kube-system fi fi - + rm -f kubeconfig - + if [[ $CLEANUP_CLUSTER == "true" ]] then - kind delete cluster ${CLUSTER_CONTEXT} - else - echo "Cluster requested to stay up, not deleting cluster" - fi + kind delete cluster ${CLUSTER_CONTEXT} + else + echo "Cluster requested to stay up, not deleting cluster" + fi } function undeploy_mcad_helm { @@ -348,10 +348,10 @@ function mcad-up { function setup-mcad-env { echo "Installing Podgroup CRD" kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/scheduler-plugins/277b6bdec18f8a9e9ccd1bfeaf4b66495bfc6f92/config/crd/bases/scheduling.sigs.k8s.io_podgroups.yaml - + # Turn off master taints kubectl taint nodes --all node-role.kubernetes.io/control-plane:NoSchedule- - + # This is meant to orchestrate initial cluster configuration such that accounting tests can be consistent echo "Orchestrate cluster..." echo "kubectl cordon test-worker" @@ -369,7 +369,7 @@ function setup-mcad-env { echo "Waiting for pod in the kube-system namespace to be ready to become ready" while [[ $(kubectl get pods -n kube-system -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}' | tr ' ' '\n' | sort -u) != "True" ]] do - echo -n "." && sleep 1; + echo -n "." && sleep 1; done } @@ -451,7 +451,7 @@ function kuttl-tests { then echo "Failed to delete quotasubtrees for test: '${kuttl_test}'" exit 1 - fi + fi undeploy_mcad_helm done rm -f kubeconfig @@ -459,7 +459,7 @@ function kuttl-tests { trap cleanup EXIT update_test_host -check-prerequisites +check-prerequisites kind-up-cluster extend-resources setup-mcad-env