Merge pull request #34468 from mtaufen/fix-upgrade-image-setup

Automatic merge from submit-queue

Fix upgrade.sh image setup

The original fix (#33147) sourced the correct `node-helper.sh` but set
`node_os_distribution` instead of `NODE_OS_DISTRIBUTION`. The
`set-node-image` function is imported indirectly via `source
"${KUBE_ROOT}/cluster/kube-util.sh"`, which in turn (in the GCE case)
sources `cluster/gce/util.sh`. Since the `set-node-image` function
relies on the `NODE_OS_DISTRIBUTION` variable, the original fix
did not have the entire intended effect.

I have confirmed that cherry-picking #33147 into the `release-1.4`
branch and layering this commit on top of it make for a successful
upgrade from a GCI based K8s 1.3 cluster to a GCI based K8s 1.4 cluster.


**NOTE:** This, along with #33147, should be cherry-picked into the `release-1.4` branch.
This commit is contained in:
Kubernetes Submit Queue 2016-10-10 23:53:42 -07:00 committed by GitHub
commit 788787a0d4

View File

@ -179,8 +179,8 @@ function upgrade-nodes() {
function setup-base-image() {
if [[ "${env_os_distro}" == "false" ]]; then
echo "== Ensuring that new Node base OS image matched the existing Node base OS image"
node_os_distribution=$(get-node-os "${NODE_NAMES[0]}")
source "${KUBE_ROOT}/cluster/gce/${node_os_distribution}/node-helper.sh"
NODE_OS_DISTRIBUTION=$(get-node-os "${NODE_NAMES[0]}")
source "${KUBE_ROOT}/cluster/gce/${NODE_OS_DISTRIBUTION}/node-helper.sh"
# Reset the node image based on current os distro
set-node-image
fi