diff --git a/pkg/scripts/render.go b/pkg/scripts/render.go index 3a69d9296..a50ff5b64 100644 --- a/pkg/scripts/render.go +++ b/pkg/scripts/render.go @@ -59,10 +59,7 @@ var ( sudo apt-get update {{ end }} - {{- if or .FORCE .UPGRADE }} sudo apt-mark unhold docker-ce docker-ce-cli containerd.io || true - {{- end }} - {{- $DOCKER_VERSION_TO_INSTALL := "%s" }} {{- if semverCompare "< 1.17" .KUBERNETES_VERSION }} {{ $DOCKER_VERSION_TO_INSTALL = "%s" }} @@ -95,9 +92,7 @@ var ( ), "yum-docker-ce-amzn": heredoc.Docf(` - {{- if or .FORCE .UPGRADE }} sudo yum versionlock delete docker cri-tools containerd - {{- end }} {{- $CRICTL_VERSION_TO_INSTALL := "%s" }} {{- $DOCKER_VERSION_TO_INSTALL := "%s" }} @@ -137,9 +132,7 @@ var ( sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true >/dev/null {{- end }} - {{- if or .FORCE .UPGRADE }} sudo yum versionlock delete docker-ce docker-ce-cli containerd.io - {{- end }} {{- $DOCKER_VERSION_TO_INSTALL := "%s" }} {{- if semverCompare "< 1.17" .KUBERNETES_VERSION }} @@ -192,10 +185,7 @@ var ( sudo add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" {{ end }} - {{ if or .FORCE .UPGRADE }} sudo apt-mark unhold containerd.io || true - {{ end }} - sudo apt-get install -y containerd.io=%s sudo apt-mark hold containerd.io @@ -215,10 +205,7 @@ var ( sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true {{ end }} - {{ if or .FORCE .UPGRADE }} sudo yum versionlock delete containerd.io - {{- end }} - sudo yum install -y containerd.io-%s sudo yum versionlock add containerd.io @@ -228,10 +215,7 @@ var ( ), "yum-containerd-amzn": heredoc.Docf(` - {{- if or .FORCE .UPGRADE }} sudo yum versionlock delete containerd cri-tools - {{- end }} - sudo yum install -y containerd-%s cri-tools-%s sudo yum versionlock add containerd cri-tools diff --git a/pkg/scripts/testdata/TestKubeadmAmazonLinux-force.golden b/pkg/scripts/testdata/TestKubeadmAmazonLinux-force.golden index 7294a55d7..e0ff8deb5 100644 --- a/pkg/scripts/testdata/TestKubeadmAmazonLinux-force.golden +++ b/pkg/scripts/testdata/TestKubeadmAmazonLinux-force.golden @@ -83,7 +83,6 @@ cat </dev/null + sudo yum versionlock delete docker-ce docker-ce-cli containerd.io sudo yum install -y \ diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry.golden b/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry.golden index 4d4c8b3b9..f1fe47cfc 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry.golden @@ -89,6 +89,8 @@ sudo yum install -y yum-utils sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true >/dev/null +sudo yum versionlock delete docker-ce docker-ce-cli containerd.io + sudo yum install -y \ docker-ce-19.03.* \ docker-ce-cli-19.03.* \ diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry_insecure.golden b/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry_insecure.golden index 5642cfca8..7651e4664 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry_insecure.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-overwrite_registry_insecure.golden @@ -92,6 +92,8 @@ sudo yum install -y yum-utils sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true >/dev/null +sudo yum versionlock delete docker-ce docker-ce-cli containerd.io + sudo yum install -y \ docker-ce-19.03.* \ docker-ce-cli-19.03.* \ diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-proxy.golden b/pkg/scripts/testdata/TestKubeadmCentOS-proxy.golden index 495831cda..d254a98ac 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-proxy.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-proxy.golden @@ -89,6 +89,8 @@ sudo yum install -y yum-utils sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true >/dev/null +sudo yum versionlock delete docker-ce docker-ce-cli containerd.io + sudo yum install -y \ docker-ce-19.03.* \ docker-ce-cli-19.03.* \ diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-simple.golden b/pkg/scripts/testdata/TestKubeadmCentOS-simple.golden index 4d4c8b3b9..f1fe47cfc 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-simple.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-simple.golden @@ -89,6 +89,8 @@ sudo yum install -y yum-utils sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true >/dev/null +sudo yum versionlock delete docker-ce docker-ce-cli containerd.io + sudo yum install -y \ docker-ce-19.03.* \ docker-ce-cli-19.03.* \ diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-v1.16.1.golden b/pkg/scripts/testdata/TestKubeadmCentOS-v1.16.1.golden index 6032b9938..bfd08833b 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-v1.16.1.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-v1.16.1.golden @@ -88,6 +88,8 @@ EOF sudo yum install -y yum-utils sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true >/dev/null + +sudo yum versionlock delete docker-ce docker-ce-cli containerd.io # Docker provides two different apt repos for CentOS, 7 and 8. The 8 repo currently # contains only Docker 19.03.14, which is not validated for all Kubernetes version. # Therefore, we use 7 repo which has all Docker versions. diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden index e858abbc6..0453fc234 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden @@ -77,8 +77,7 @@ sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/dock sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true - - +sudo yum versionlock delete containerd.io sudo yum install -y containerd.io-1.4.* sudo yum versionlock add containerd.io diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd_with_insecure_registry.golden b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd_with_insecure_registry.golden index b17c92cbb..2e076fff9 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd_with_insecure_registry.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd_with_insecure_registry.golden @@ -77,8 +77,7 @@ sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/dock sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true - - +sudo yum versionlock delete containerd.io sudo yum install -y containerd.io-1.4.* sudo yum versionlock add containerd.io diff --git a/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry.golden b/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry.golden index 600d04130..00df2d178 100644 --- a/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry.golden +++ b/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry.golden @@ -87,6 +87,8 @@ echo "deb https://download.docker.com/linux/ubuntu bionic stable" | sudo apt-get update +sudo apt-mark unhold docker-ce docker-ce-cli containerd.io || true + sudo DEBIAN_FRONTEND=noninteractive apt-get install \ --option "Dpkg::Options::=--force-confold" \ --no-install-recommends \ diff --git a/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry_insecure.golden b/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry_insecure.golden index 331672dc1..46cb79f9e 100644 --- a/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry_insecure.golden +++ b/pkg/scripts/testdata/TestKubeadmDebian-overwrite_registry_insecure.golden @@ -90,6 +90,8 @@ echo "deb https://download.docker.com/linux/ubuntu bionic stable" | sudo apt-get update +sudo apt-mark unhold docker-ce docker-ce-cli containerd.io || true + sudo DEBIAN_FRONTEND=noninteractive apt-get install \ --option "Dpkg::Options::=--force-confold" \ --no-install-recommends \ diff --git a/pkg/scripts/testdata/TestKubeadmDebian-simple.golden b/pkg/scripts/testdata/TestKubeadmDebian-simple.golden index 600d04130..00df2d178 100644 --- a/pkg/scripts/testdata/TestKubeadmDebian-simple.golden +++ b/pkg/scripts/testdata/TestKubeadmDebian-simple.golden @@ -87,6 +87,8 @@ echo "deb https://download.docker.com/linux/ubuntu bionic stable" | sudo apt-get update +sudo apt-mark unhold docker-ce docker-ce-cli containerd.io || true + sudo DEBIAN_FRONTEND=noninteractive apt-get install \ --option "Dpkg::Options::=--force-confold" \ --no-install-recommends \ diff --git a/pkg/scripts/testdata/TestKubeadmDebian-with_containerd.golden b/pkg/scripts/testdata/TestKubeadmDebian-with_containerd.golden index a15f20250..a633eb85d 100644 --- a/pkg/scripts/testdata/TestKubeadmDebian-with_containerd.golden +++ b/pkg/scripts/testdata/TestKubeadmDebian-with_containerd.golden @@ -72,8 +72,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - +sudo apt-mark unhold containerd.io || true sudo apt-get install -y containerd.io=1.4.* sudo apt-mark hold containerd.io diff --git a/pkg/scripts/testdata/TestKubeadmDebian-with_containerd_with_insecure_registry.golden b/pkg/scripts/testdata/TestKubeadmDebian-with_containerd_with_insecure_registry.golden index 071d29f46..049122c69 100644 --- a/pkg/scripts/testdata/TestKubeadmDebian-with_containerd_with_insecure_registry.golden +++ b/pkg/scripts/testdata/TestKubeadmDebian-with_containerd_with_insecure_registry.golden @@ -72,8 +72,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - - +sudo apt-mark unhold containerd.io || true sudo apt-get install -y containerd.io=1.4.* sudo apt-mark hold containerd.io diff --git a/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIAmazonLinux.golden b/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIAmazonLinux.golden index ee5274652..77155f718 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIAmazonLinux.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIAmazonLinux.golden @@ -83,7 +83,6 @@ cat </dev/null + sudo yum versionlock delete docker-ce docker-ce-cli containerd.io sudo yum install -y \ diff --git a/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIDebian.golden b/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIDebian.golden index 9c80bfa5c..b5da82888 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIDebian.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeadmAndCNIDebian.golden @@ -87,6 +87,7 @@ echo "deb https://download.docker.com/linux/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt-get update + sudo apt-mark unhold docker-ce docker-ce-cli containerd.io || true sudo DEBIAN_FRONTEND=noninteractive apt-get install \ diff --git a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlAmazonLinux.golden b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlAmazonLinux.golden index fdaee5014..d2ed365ad 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlAmazonLinux.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlAmazonLinux.golden @@ -83,7 +83,6 @@ cat </dev/null + sudo yum versionlock delete docker-ce docker-ce-cli containerd.io sudo yum install -y \ diff --git a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden index 5f95d3cd3..2b22cf420 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden @@ -87,6 +87,7 @@ echo "deb https://download.docker.com/linux/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt-get update + sudo apt-mark unhold docker-ce docker-ce-cli containerd.io || true sudo DEBIAN_FRONTEND=noninteractive apt-get install \