kubeadm: drop older etcd versions from kubeadm support

- drop versions < 1.22 in the etcd map
- use 3.5.9-0 for >= 1.22 versions
- make the minimum version for external etcd 3.4.13-4 and max 3.5.9-0
- update images_test to not rely on a pinned etcd version in tests

note: the image 3.4.18-0 was never released in registry.k8s.io!
This commit is contained in:
Lubomir I. Ivanov 2023-06-18 15:17:54 +03:00
parent 1ff1a26426
commit ede2ec22b6
2 changed files with 15 additions and 19 deletions

View File

@ -306,7 +306,7 @@ const (
KubeletHealthzPort = 10248
// MinExternalEtcdVersion indicates minimum external etcd version which kubeadm supports
MinExternalEtcdVersion = "3.4.3-0"
MinExternalEtcdVersion = "3.4.13-4"
// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
DefaultEtcdVersion = "3.5.9-0"
@ -467,17 +467,12 @@ var (
// SupportedEtcdVersion lists officially supported etcd versions with corresponding Kubernetes releases
SupportedEtcdVersion = map[uint8]string{
17: "3.4.3-0",
18: "3.4.3-0",
19: "3.4.18-0",
20: "3.4.18-0",
21: "3.4.18-0",
22: "3.5.8-0",
23: "3.5.8-0",
24: "3.5.8-0",
25: "3.5.8-0",
26: "3.5.8-0",
27: "3.5.8-0",
22: "3.5.9-0",
23: "3.5.9-0",
24: "3.5.9-0",
25: "3.5.9-0",
26: "3.5.9-0",
27: "3.5.9-0",
28: "3.5.9-0",
}

View File

@ -27,8 +27,8 @@ import (
)
const (
testversion = "v10.1.2-alpha.1.100+0123456789abcdef+SOMETHING"
expected = "v10.1.2-alpha.1.100_0123456789abcdef_SOMETHING"
testversion = "v10.1.2-alpha.1.100+0123456789abcdef"
expected = "v10.1.2-alpha.1.100_0123456789abcdef"
gcrPrefix = "registry.k8s.io"
)
@ -97,6 +97,7 @@ func TestGetKubernetesImage(t *testing.T) {
}
func TestGetEtcdImage(t *testing.T) {
testEtcdVer, _, _ := constants.EtcdSupportedVersion(constants.SupportedEtcdVersion, testversion)
var tests = []struct {
expected string
cfg *kubeadmapi.ClusterConfiguration
@ -104,17 +105,17 @@ func TestGetEtcdImage(t *testing.T) {
{
cfg: &kubeadmapi.ClusterConfiguration{
ImageRepository: "real.repo",
KubernetesVersion: "1.18.0",
KubernetesVersion: testversion,
Etcd: kubeadmapi.Etcd{
Local: &kubeadmapi.LocalEtcd{},
},
},
expected: "real.repo/etcd:3.4.3-0",
expected: "real.repo/etcd:" + testEtcdVer.String(),
},
{
cfg: &kubeadmapi.ClusterConfiguration{
ImageRepository: "real.repo",
KubernetesVersion: "1.18.0",
KubernetesVersion: testversion,
Etcd: kubeadmapi.Etcd{
Local: &kubeadmapi.LocalEtcd{
ImageMeta: kubeadmapi.ImageMeta{
@ -128,7 +129,7 @@ func TestGetEtcdImage(t *testing.T) {
{
cfg: &kubeadmapi.ClusterConfiguration{
ImageRepository: "real.repo",
KubernetesVersion: "1.18.0",
KubernetesVersion: testversion,
Etcd: kubeadmapi.Etcd{
Local: &kubeadmapi.LocalEtcd{
ImageMeta: kubeadmapi.ImageMeta{
@ -137,7 +138,7 @@ func TestGetEtcdImage(t *testing.T) {
},
},
},
expected: "override/etcd:3.4.3-0",
expected: "override/etcd:" + testEtcdVer.String(),
},
{
expected: GetGenericImage(gcrPrefix, "etcd", constants.DefaultEtcdVersion),