diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index e7a75b6b0d6..01555e65908 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -464,14 +464,20 @@ function update-coredns-config() { cleanup() { rm -rf "${download_dir}" } - trap cleanup EXIT + trap cleanup RETURN # Get the new installed CoreDNS version - echo "Waiting for CoreDNS to update" - until [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]]; do + echo "== Waiting for CoreDNS to update ==" + local -r endtime=$(date -ud "3 minute" +%s) + until [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]] || [[ $(date -u +%s) -gt $endtime ]]; do sleep 1 done - echo "Fetching the latest installed CoreDNS version" + + if [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]]; then + echo "== CoreDNS ResourceVersion changed ==" + fi + + echo "== Fetching the latest installed CoreDNS version ==" NEW_COREDNS_VERSION=$("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.spec.template.spec.containers[:1].image}' | cut -d ":" -f 2) case "$(uname -m)" in