Merge pull request #94987 from zshihang/fix-upgrade

fix upgrade test
This commit is contained in:
Kubernetes Prow Robot 2020-10-13 17:23:54 -07:00 committed by GitHub
commit 5c5d26786e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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