Skip to content

Commit

Permalink
kubeadm: drop older etcd versions from kubeadm support
Browse files Browse the repository at this point in the history
- 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!
  • Loading branch information
neolit123 committed Jun 18, 2023
1 parent 1ff1a26 commit ede2ec2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
19 changes: 7 additions & 12 deletions cmd/kubeadm/app/constants/constants.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
}

Expand Down
15 changes: 8 additions & 7 deletions cmd/kubeadm/app/images/images_test.go
Expand Up @@ -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"
)

Expand Down Expand Up @@ -97,24 +97,25 @@ func TestGetKubernetesImage(t *testing.T) {
}

func TestGetEtcdImage(t *testing.T) {
testEtcdVer, _, _ := constants.EtcdSupportedVersion(constants.SupportedEtcdVersion, testversion)
var tests = []struct {
expected string
cfg *kubeadmapi.ClusterConfiguration
}{
{
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{
Expand All @@ -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{
Expand All @@ -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),
Expand Down

0 comments on commit ede2ec2

Please sign in to comment.