Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: only remove CRI if re-installing (#3654)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Jul 30, 2020
1 parent 7fccb42 commit fd2c45d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 1 addition & 7 deletions parts/k8s/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ configureAzureCNI() {
}
{{- if NeedsContainerd}}
installContainerd() {
removeMoby
CURRENT_VERSION=$(containerd -version | cut -d " " -f 3 | sed 's|v||')
if [[ $CURRENT_VERSION != "${CONTAINERD_VERSION}" ]]; then
os_lower=$(echo ${OS} | tr '[:upper:]' '[:lower:]')
Expand All @@ -307,6 +306,7 @@ installContainerd() {
else
exit 25
fi
removeMoby
removeContainerd
retrycmd_no_stats 120 5 25 curl https://packages.microsoft.com/config/ubuntu/${UBUNTU_RELEASE}/prod.list >/tmp/microsoft-prod.list || exit 25
retrycmd 10 5 10 cp /tmp/microsoft-prod.list /etc/apt/sources.list.d/ || exit 25
Expand Down Expand Up @@ -678,10 +678,4 @@ cleanUpContainerd() {
removeEtcd() {
rm -rf /usr/bin/etcd
}
removeMoby() {
apt_get_purge moby-engine moby-cli || exit 27
}
removeContainerd() {
apt_get_purge moby-containerd || exit 27
}
#EOF
8 changes: 7 additions & 1 deletion parts/k8s/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ downloadGPUDrivers() {
exit 85
fi
}
removeMoby() {
apt_get_purge moby-engine moby-cli || exit 27
}
removeContainerd() {
apt_get_purge moby-containerd || exit 27
}
installMoby() {
removeContainerd
CURRENT_VERSION=$(dockerd --version | grep "Docker version" | cut -d "," -f 1 | cut -d " " -f 3 | cut -d "+" -f 1)
if [[ $CURRENT_VERSION != "${MOBY_VERSION}" ]]; then
removeContainerd
removeMoby
retrycmd_no_stats 120 5 25 curl https://packages.microsoft.com/config/ubuntu/${UBUNTU_RELEASE}/prod.list >/tmp/microsoft-prod.list || exit 25
retrycmd 10 5 10 cp /tmp/microsoft-prod.list /etc/apt/sources.list.d/ || exit 25
Expand Down
16 changes: 8 additions & 8 deletions pkg/engine/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fd2c45d

Please sign in to comment.