From 929225f40120c18df440663c0f1c4083665214bb Mon Sep 17 00:00:00 2001 From: Artiom Diomin Date: Wed, 24 Jul 2024 11:41:00 +0300 Subject: [PATCH] CentOS docker repo being abandoned, replaced with RHEL Signed-off-by: Artiom Diomin --- pkg/scripts/render.go | 7 +------ .../testdata/TestKubeadmCentOS-cilium_cluster.golden | 3 +-- .../testdata/TestKubeadmCentOS-nutanix_cluster.golden | 3 +-- .../testdata/TestKubeadmCentOS-with_containerd.golden | 3 +-- ...dmCentOS-with_containerd_with_insecure_registry.golden | 3 +-- .../testdata/TestUpgradeKubeadmAndCNICentOS.golden | 3 +-- .../testdata/TestUpgradeKubeletAndKubectlCentOS.golden | 3 +-- pkg/tasks/prerequisites.go | 8 ++++---- 8 files changed, 11 insertions(+), 22 deletions(-) diff --git a/pkg/scripts/render.go b/pkg/scripts/render.go index 3576bb9fc..8d1741e59 100644 --- a/pkg/scripts/render.go +++ b/pkg/scripts/render.go @@ -79,12 +79,7 @@ var containerRuntimeTemplates = map[string]string{ "yum-containerd": heredoc.Docf(` {{ if .CONFIGURE_REPOSITORIES }} sudo yum install -y yum-utils - sudo yum-config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo - {{- /* - Due to DNF modules we have to do this on docker-ce repo - More info at: https://bugzilla.redhat.com/show_bug.cgi?id=1756473 - */}} - sudo yum-config-manager --save --setopt=docker-ce-stable.module_hotfixes=true + sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo {{ end }} sudo yum versionlock delete containerd.io || true diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-cilium_cluster.golden b/pkg/scripts/testdata/TestKubeadmCentOS-cilium_cluster.golden index 8e049ddd6..110b96e9b 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-cilium_cluster.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-cilium_cluster.golden @@ -88,8 +88,7 @@ sudo yum install -y \ 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 +sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo sudo yum versionlock delete containerd.io || true diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-nutanix_cluster.golden b/pkg/scripts/testdata/TestKubeadmCentOS-nutanix_cluster.golden index 784b14933..9c95a8690 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-nutanix_cluster.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-nutanix_cluster.golden @@ -91,8 +91,7 @@ sudo systemctl enable --now iscsid 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 +sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo sudo yum versionlock delete containerd.io || true diff --git a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden index 8e049ddd6..110b96e9b 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd.golden @@ -88,8 +88,7 @@ sudo yum install -y \ 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 +sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo sudo yum versionlock delete containerd.io || true 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 a200d39ff..d4c658b57 100644 --- a/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd_with_insecure_registry.golden +++ b/pkg/scripts/testdata/TestKubeadmCentOS-with_containerd_with_insecure_registry.golden @@ -88,8 +88,7 @@ sudo yum install -y \ 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 +sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo sudo yum versionlock delete containerd.io || true diff --git a/pkg/scripts/testdata/TestUpgradeKubeadmAndCNICentOS.golden b/pkg/scripts/testdata/TestUpgradeKubeadmAndCNICentOS.golden index add512cbd..911160055 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeadmAndCNICentOS.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeadmAndCNICentOS.golden @@ -88,8 +88,7 @@ sudo yum install -y \ 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 +sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo sudo yum versionlock delete containerd.io || true diff --git a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlCentOS.golden b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlCentOS.golden index 4ccde94c5..dbcc9f8aa 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlCentOS.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlCentOS.golden @@ -88,8 +88,7 @@ sudo yum install -y \ 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 +sudo yum-config-manager --add-repo=https://download.docker.com/linux/rhel/docker-ce.repo sudo yum versionlock delete containerd.io || true diff --git a/pkg/tasks/prerequisites.go b/pkg/tasks/prerequisites.go index 1a15b77d8..fafc95f7a 100644 --- a/pkg/tasks/prerequisites.go +++ b/pkg/tasks/prerequisites.go @@ -196,11 +196,11 @@ func disableNMCloudSetup(s *state.State, node *kubeoneapi.HostConfig, _ executor func installKubeadm(s *state.State, node kubeoneapi.HostConfig) error { return runOnOS(s, node.OperatingSystem, map[kubeoneapi.OperatingSystemName]runOnOSFn{ kubeoneapi.OperatingSystemNameAmazon: installKubeadmAmazonLinux, - kubeoneapi.OperatingSystemNameCentOS: installKubeadmCentOS, + kubeoneapi.OperatingSystemNameCentOS: installKubeadmRHELAndAlike, kubeoneapi.OperatingSystemNameDebian: installKubeadmDebian, kubeoneapi.OperatingSystemNameFlatcar: installKubeadmFlatcar, - kubeoneapi.OperatingSystemNameRHEL: installKubeadmCentOS, - kubeoneapi.OperatingSystemNameRockyLinux: installKubeadmCentOS, + kubeoneapi.OperatingSystemNameRHEL: installKubeadmRHELAndAlike, + kubeoneapi.OperatingSystemNameRockyLinux: installKubeadmRHELAndAlike, kubeoneapi.OperatingSystemNameUbuntu: installKubeadmDebian, }) } @@ -216,7 +216,7 @@ func installKubeadmDebian(s *state.State) error { return fail.SSH(err, "installing kubeadm") } -func installKubeadmCentOS(s *state.State) error { +func installKubeadmRHELAndAlike(s *state.State) error { cmd, err := scripts.KubeadmCentOS(s.Cluster, s.ForceInstall) if err != nil { return err