From 5961195ee20007157b4c755d6dbc127f9255ca64 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Tue, 19 Jan 2021 15:18:57 +0100 Subject: [PATCH] Squashed 'release-tools/' changes from c6a88c6e..ece0f500 ece0f500 check namespace for snapshot-controller 3b6d17b1 Merge pull request #118 from pohly/cloud-build-timeout 9318c6cc cloud build: double the timeout, now 1 hour 86ff5802 Merge pull request #116 from andyzhangx/export-image-name c3a96625 allow export image name and registry name git-subtree-dir: release-tools git-subtree-split: ece0f500ed9ee6c197ffce6d410d12edd8bf7365 --- build.make | 2 +- cloudbuild.yaml | 4 +++- prow.sh | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build.make b/build.make index 516dc12d7..ca2be670a 100644 --- a/build.make +++ b/build.make @@ -20,7 +20,7 @@ # This is the default. It can be overridden in the main Makefile after # including build.make. -REGISTRY_NAME=quay.io/k8scsi +REGISTRY_NAME?=quay.io/k8scsi # Can be set to -mod=vendor to ensure that the "vendor" directory is used. GOFLAGS_VENDOR= diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 8f678924e..7f0a4341c 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -16,7 +16,9 @@ # To promote release images, see https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage. # This must be specified in seconds. If omitted, defaults to 600s (10 mins). -timeout: 1800s +# Building three images in external-snapshotter takes roughly half an hour, +# sometimes more. +timeout: 3600s # This prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF, # or any new substitutions added in the future. options: diff --git a/prow.sh b/prow.sh index 44511fb23..a70acbd7a 100755 --- a/prow.sh +++ b/prow.sh @@ -796,16 +796,17 @@ install_snapshot_controller() { echo "kubectl apply -f ${SNAPSHOT_CONTROLLER_YAML}(modified)" done else - echo "kubectl apply -f ${CONTROLLER_DIR}/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml" - kubectl apply -f "${CONTROLLER_DIR}/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml" + echo "kubectl apply -f $SNAPSHOT_CONTROLLER_YAML" + kubectl apply -f "$SNAPSHOT_CONTROLLER_YAML" fi cnt=0 - expected_running_pods=$(curl https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${CSI_SNAPSHOTTER_VERSION}"/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml | grep replicas | cut -d ':' -f 2-) - while [ "$(kubectl get pods -l app=snapshot-controller | grep 'Running' -c)" -lt "$expected_running_pods" ]; do + expected_running_pods=$(kubectl apply --dry-run=client -o "jsonpath={.spec.replicas}" -f "$SNAPSHOT_CONTROLLER_YAML") + expected_namespace=$(kubectl apply --dry-run=client -o "jsonpath={.metadata.namespace}" -f "$SNAPSHOT_CONTROLLER_YAML") + while [ "$(kubectl get pods -n "$expected_namespace" -l app=snapshot-controller | grep 'Running' -c)" -lt "$expected_running_pods" ]; do if [ $cnt -gt 30 ]; then echo "snapshot-controller pod status:" - kubectl describe pods -l app=snapshot-controller + kubectl describe pods -n "$expected_namespace" -l app=snapshot-controller echo >&2 "ERROR: snapshot controller not ready after over 5 min" exit 1 fi