mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #33147 from vishh/fix-upgrade-sh
Automatic merge from submit-queue Fix base image pinning during upgrades via cluster/gce/upgrade.sh Fixes #33056 cc @timstclair @maisem
This commit is contained in:
commit
cccd3b3234
@ -125,6 +125,7 @@ function wait-for-master() {
|
|||||||
function prepare-upgrade() {
|
function prepare-upgrade() {
|
||||||
ensure-temp-dir
|
ensure-temp-dir
|
||||||
detect-project
|
detect-project
|
||||||
|
detect-node-names # sets INSTANCE_GROUPS
|
||||||
write-cluster-name
|
write-cluster-name
|
||||||
tars_from_version
|
tars_from_version
|
||||||
}
|
}
|
||||||
@ -175,6 +176,16 @@ function upgrade-nodes() {
|
|||||||
do-node-upgrade
|
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
|
# 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.
|
# to KUBE_VERSION and echos a single line with the name of the new template.
|
||||||
#
|
#
|
||||||
@ -196,9 +207,9 @@ function upgrade-nodes() {
|
|||||||
# KUBELET_KEY_BASE64
|
# KUBELET_KEY_BASE64
|
||||||
function prepare-node-upgrade() {
|
function prepare-node-upgrade() {
|
||||||
echo "== Preparing node upgrade (to ${KUBE_VERSION}). ==" >&2
|
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.
|
# TODO(zmerlynn): Refactor setting scope flags.
|
||||||
local scope_flags=
|
local scope_flags=
|
||||||
@ -221,13 +232,6 @@ function prepare-node-upgrade() {
|
|||||||
# compatible way?
|
# compatible way?
|
||||||
write-node-env
|
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
|
# TODO(zmerlynn): Get configure-vm script from ${version}. (Must plumb this
|
||||||
# through all create-node-instance-template implementations).
|
# through all create-node-instance-template implementations).
|
||||||
local template_name=$(get-template-name-from-version ${SANITIZED_VERSION})
|
local template_name=$(get-template-name-from-version ${SANITIZED_VERSION})
|
||||||
|
Loading…
Reference in New Issue
Block a user