Skip to content

Commit 079cd8d

Browse files
committed
fix upgrade test
1 parent b0ca7f1 commit 079cd8d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cluster/gce/upgrade.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,20 @@ function update-coredns-config() {
464464
cleanup() {
465465
rm -rf "${download_dir}"
466466
}
467-
trap cleanup EXIT
467+
trap cleanup RETURN
468468

469469
# Get the new installed CoreDNS version
470-
echo "Waiting for CoreDNS to update"
471-
until [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]]; do
470+
echo "== Waiting for CoreDNS to update =="
471+
local -r endtime=$(date -ud "3 minute" +%s)
472+
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
472473
sleep 1
473474
done
474-
echo "Fetching the latest installed CoreDNS version"
475+
476+
if [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]]; then
477+
echo "== CoreDNS ResourceVersion changed =="
478+
fi
479+
480+
echo "== Fetching the latest installed CoreDNS version =="
475481
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)
476482

477483
case "$(uname -m)" in

0 commit comments

Comments
 (0)