Skip to content

get ETCD version from kubernetes constants #11290

Open
@medyagh

Description

currently in https://github.com/medyagh/minikube/blob/a67a4ccbedd932f184b5713c70498dc434942621/pkg/minikube/bootstrapper/images/images.go#L86
we have

// etcd returns the image used for etcd
func etcd(v semver.Version, mirror string) string {
	// Should match `DefaultEtcdVersion` in:
	// https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants.go
	ev := "3.4.13-0"

	switch v.Minor {
	case 17, 18:
		ev = "3.4.3-0"
	case 16:
		ev = "3.3.15-0"
	case 14, 15:
		ev = "3.3.10"
	case 12, 13:
		ev = "3.2.24"
	case 11:
		ev = "3.2.18"
	}

	// An awkward special case for v1.19.0 - do not imitate unless necessary
	if v.Equals(semver.MustParse("1.19.0")) {
		ev = "3.4.9-1"
	}

	return path.Join(kubernetesRepo(mirror), "etcd:"+ev)
}

instead we should use this map in kuberentes so we dont have to update this manually

https://github.com/kubernetes/kubernetes/blob/b58a7e233e06f5e4b58a637af8e36cb4f59c001b/cmd/kubeadm/app/constants/constants.go#L452


	// SupportedEtcdVersion lists officially supported etcd versions with corresponding Kubernetes releases
	SupportedEtcdVersion = map[uint8]string{
		13: "3.2.24",
		14: "3.3.10",
		15: "3.3.10",
		16: "3.3.17-0",
		17: "3.4.3-0",
		18: "3.4.3-0",
		19: "3.4.13-0",
		20: "3.4.13-0",
		21: "3.4.13-0",
		22: "3.4.13-0",
		23: "3.4.13-0",
	}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions