Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix base image pinning during upgrades via cluster/gce/upgrade.sh #33147

Merged
merged 1 commit into from Oct 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 13 additions & 9 deletions cluster/gce/upgrade.sh
Expand Up @@ -125,6 +125,7 @@ function wait-for-master() {
function prepare-upgrade() {
ensure-temp-dir
detect-project
detect-node-names # sets INSTANCE_GROUPS
write-cluster-name
tars_from_version
}
Expand Down Expand Up @@ -175,6 +176,16 @@ function upgrade-nodes() {
do-node-upgrade
}

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"
# Reset the node image based on current os distro
set-node-image
fi
}

# prepare-node-upgrade creates a new instance template suitable for upgrading
# to KUBE_VERSION and echos a single line with the name of the new template.
#
Expand All @@ -196,9 +207,9 @@ function upgrade-nodes() {
# KUBELET_KEY_BASE64
function prepare-node-upgrade() {
echo "== Preparing node upgrade (to ${KUBE_VERSION}). ==" >&2
SANITIZED_VERSION=$(echo ${KUBE_VERSION} | sed 's/[\.\+]/-/g')
setup-base-image

detect-node-names # sets INSTANCE_GROUPS
SANITIZED_VERSION=$(echo ${KUBE_VERSION} | sed 's/[\.\+]/-/g')

# TODO(zmerlynn): Refactor setting scope flags.
local scope_flags=
Expand All @@ -221,13 +232,6 @@ function prepare-node-upgrade() {
# compatible way?
write-node-env

if [[ "${env_os_distro}" == "false" ]]; then
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

# TODO(zmerlynn): Get configure-vm script from ${version}. (Must plumb this
# through all create-node-instance-template implementations).
local template_name=$(get-template-name-from-version ${SANITIZED_VERSION})
Expand Down