diff --git a/scripts/bundle-images.sh b/scripts/bundle-images.sh index 1eb7afaea..4fe368548 100755 --- a/scripts/bundle-images.sh +++ b/scripts/bundle-images.sh @@ -36,7 +36,7 @@ function wait_for_deploy_exist() { start_time=$(date +%s) - echo "Verifying provider Deployment with label: \"${deployment_label}\" exists in namespace: \"${NAMESPACE}\"..." + echo "Waiting up to ${max_wait_secs}s for provider Deployment with label: \"${deployment_label}\" to exist in namespace: \"${NAMESPACE}\"..." while true; do current_time=$(date +%s) @@ -111,6 +111,8 @@ do wait_for_deploy_exist "$LABEL_KEY=$label_value" + echo "Verifying Deployment(s) with ${LABEL_KEY}=${label_value} label is condition=available..." + ${KUBECTL} wait --for condition=available --timeout=10m deploy -l ${LABEL_KEY}=${label_value} -n ${NAMESPACE} if [[ $? -ne 0 ]]; then echo "Error: Timed out waiting for available Deployment with ${LABEL_KEY}=${label_value} label" @@ -136,7 +138,7 @@ do exit 1 fi - if [[ $image == "docker.io/hmc/controller:latest" ]]; then + if [[ $image == "localhost/hmc/controller:latest" ]]; then # Don't try to pull and package the local controller image. continue fi @@ -185,6 +187,18 @@ do fi # Use 'helm template' to get the images used by the extension. + template_output=${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml + if [[ $? -ne 0 ]]; then + echo "Error: Failed to get images from Helm template for ${name}, trying to output values with debug..." + + template_output=${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml --debug + if [[ $? -ne 0 ]]; then + echo "Error: Failed to get images from Helm template for ${name} with debug output" + exit 1 + fi + fi + + for image in $(${HELM} template --repo ${url} --version ${version} ${name} --values ${name}-values.yaml | $YQ -N e .spec.template.spec.containers[].image); do docker pull ${image}