Skip to content

Commit

Permalink
do not fail upgrades due to newer installed containerd on host-contai…
Browse files Browse the repository at this point in the history
…nerd OSes (#5357)

* validate use_os_containerd function

* use skip containerd no-downgrade checks on host-containerd OSes

* do not check postupgrade containerd version on host-containerd oses

* f
  • Loading branch information
laverya committed Aug 23, 2024
1 parent 1054726 commit 3b06ab2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
7 changes: 0 additions & 7 deletions addons/containerd/1.6.33/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,6 @@ function containerd_kubernetes_pause_image() {
fi
}

function use_os_containerd() {
if is_amazon_2023 || is_ubuntu_2404 ; then
return 0
fi
return 1
}

# require_os_containerd ensures that the host package for containerd is installed if the OS is one we do not ship containerd packages for.
function require_os_containerd() {
if use_os_containerd ; then
Expand Down
7 changes: 0 additions & 7 deletions addons/containerd/template/base/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,6 @@ function containerd_kubernetes_pause_image() {
fi
}

function use_os_containerd() {
if is_amazon_2023 || is_ubuntu_2404 ; then
return 0
fi
return 1
}

# require_os_containerd ensures that the host package for containerd is installed if the OS is one we do not ship containerd packages for.
function require_os_containerd() {
if use_os_containerd ; then
Expand Down
4 changes: 3 additions & 1 deletion addons/containerd/template/testgrid/k8s-ctrd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@
validate_testfile rwtest testfile.txt
validate_read_write_object_store postupgrade upgradefile.txt
containerd --version
containerd --version | grep "__testver__"
if ! is_ubuntu_2404 && ! is_amazon_2023; then
containerd --version | grep "__testver__"
fi
- name: "flannel latest multinode"
installerSpec:
Expand Down
11 changes: 11 additions & 0 deletions scripts/common/containerd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,21 @@ export CONTAINERD_INSTALL_VERSIONS=()
function containerd_evaluate_upgrade() {
local from_version=$1
local to_version=$2
if use_os_containerd ; then
return 0
fi
echo "Evaluating if an upgrade from containerd v$from_version to v$to_version is possible."
containerd_upgrade_is_possible "$from_version" "$to_version"
echo "Containerd upgrade from v$from_version to v$to_version is possible."
for version in $(containerd_migration_steps "$from_version" "$to_version"); do
CONTAINERD_INSTALL_VERSIONS+=("$version")
done
}

function use_os_containerd() {
if ! host_packages_shipped && ! is_rhel_9_variant ; then
# we ship containerd packages for RHEL9, but not for the later no-shipped-packages distros
return 0
fi
return 1
}

0 comments on commit 3b06ab2

Please sign in to comment.