Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Sync bundled etcd versions with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
hakman committed Jul 8, 2021
1 parent 5b496a7 commit 06f47e8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 121 deletions.
49 changes: 0 additions & 49 deletions etcd-manager/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -92,31 +92,6 @@ container_pull(

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_file(
name = "etcd_3.1.12_amd64_tar",
sha256 = "4b22184bef1bba8b4908b14bae6af4a6d33ec2b91e4f7a240780e07fa43f2111",
urls = ["https://github.com/coreos/etcd/releases/download/v3.1.12/etcd-v3.1.12-linux-amd64.tar.gz"],
)

# 3.1.12 was not released for arm64
#http_file(
# name = "etcd_3.1.12_arm64_tar",
# sha256 = "4b22184bef1bba8b4908b14bae6af4a6d33ec2b91e4f7a240780e07fa43f2123",
# urls = ["https://github.com/coreos/etcd/releases/download/v3.1.12/etcd-v3.1.12-linux-arm64.tar.gz"],
#)

http_file(
name = "etcd_3.2.18_amd64_tar",
sha256 = "b729db0732448064271ea6fdcb901773c4fe917763ca07776f22d0e5e0bd4097",
urls = ["https://github.com/coreos/etcd/releases/download/v3.2.18/etcd-v3.2.18-linux-amd64.tar.gz"],
)

http_file(
name = "etcd_3.2.18_arm64_tar",
sha256 = "085c13764af02ca2762cbacade374583a532d4f75a7b996a62f67f8f044641e6",
urls = ["https://github.com/coreos/etcd/releases/download/v3.2.18/etcd-v3.2.18-linux-arm64.tar.gz"],
)

http_file(
name = "etcd_3.2.24_amd64_tar",
sha256 = "947849dbcfa13927c81236fb76a7c01d587bbab42ab1e807184cd91b026ebed7",
Expand All @@ -129,30 +104,6 @@ http_file(
urls = ["https://github.com/coreos/etcd/releases/download/v3.2.24/etcd-v3.2.24-linux-arm64.tar.gz"],
)

http_file(
name = "etcd_3.3.10_amd64_tar",
sha256 = "1620a59150ec0a0124a65540e23891243feb2d9a628092fb1edcc23974724a45",
urls = ["https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz"],
)

http_file(
name = "etcd_3.3.10_arm64_tar",
sha256 = "5ec97b0b872adce275b8130d19db314f7f2b803aeb24c4aae17a19e2d66853c4",
urls = ["https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-arm64.tar.gz"],
)

http_file(
name = "etcd_3.3.13_amd64_tar",
sha256 = "2c2e2a9867c1c61697ea0d8c0f74c7e9f1b1cf53b75dff95ca3bc03feb19ea7e",
urls = ["https://github.com/coreos/etcd/releases/download/v3.3.13/etcd-v3.3.13-linux-amd64.tar.gz"],
)

http_file(
name = "etcd_3.3.13_arm64_tar",
sha256 = "ff76e534db8378f112b48c445944069fc9923bef04dae4d66e36801da13cc8a1",
urls = ["https://github.com/coreos/etcd/releases/download/v3.3.13/etcd-v3.3.13-linux-arm64.tar.gz"],
)

http_file(
name = "etcd_3.3.17_amd64_tar",
sha256 = "8c1168a24d17a2d6772f8148ea35d4f3398c51f1e23db90c849d506adb387060",
Expand Down
15 changes: 4 additions & 11 deletions etcd-manager/images/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ load(
)
load("etcd.bzl", "supported_etcd_arch_and_version")

# Layer for etcd 3.1.12, as used in k8s 1.10
# Layer for etcd 3.2.18, as originally used in k8s 1.11
# Layer for etcd 3.1.12, as used in k8s 1.10 - REMOVED to reduce image size, using etc 3.2.24 instead
# Layer for etcd 3.2.18, as originally used in k8s 1.11 - REMOVED to reduce image size, using etc 3.2.24 instead
# Layer for etcd 3.2.24, updated recommendation for k8s 1.11 and later
# Layer for etcd 3.3.10, updated recommendation for k8s 1.14 and later
# Layer for etcd 3.3.13, updated recommendation for k8s 1.14 and later
# Layer for etcd 3.3.10, updated recommendation for k8s 1.14 and later - REMOVED to reduce image size, using etc 3.3.17 instead
# Layer for etcd 3.3.13, updated recommendation for k8s 1.14 and later - REMOVED to reduce image size, using etc 3.3.17 instead
# Layer for etcd 3.3.17, updated recommendation for k8s 1.16.3 and later
# Layer for etcd 3.4.3, updated recommendation for k8s 1.17 and later
# Layer for etcd 3.4.13, updated recommendation for k8s 1.19 and later
Expand Down Expand Up @@ -52,21 +52,14 @@ container_image(
directory = "/opt",
layers = select({
"@io_bazel_rules_go//go/platform:amd64": [
"etcd-3.1.12-layer-amd64",
"etcd-3.2.18-layer-amd64",
"etcd-3.2.24-layer-amd64",
"etcd-3.3.10-layer-amd64",
"etcd-3.3.13-layer-amd64",
"etcd-3.3.17-layer-amd64",
"etcd-3.4.3-layer-amd64",
"etcd-3.4.13-layer-amd64",
"etcd-3.5.0-layer-amd64",
],
"@io_bazel_rules_go//go/platform:arm64": [
"etcd-3.2.18-layer-arm64",
"etcd-3.2.24-layer-arm64",
"etcd-3.3.10-layer-arm64",
"etcd-3.3.13-layer-arm64",
"etcd-3.3.17-layer-arm64",
"etcd-3.4.3-layer-arm64",
"etcd-3.4.13-layer-arm64",
Expand Down
4 changes: 1 addition & 3 deletions etcd-manager/images/etcd.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
# and also avoids problems such as 3.1.12 not being available on arm
def supported_etcd_arch_and_version():
return [
[ "amd64", "3.1.12" ],
] + [
(arch, version)
for arch in ["amd64", "arm64"]
for version in ["3.2.18", "3.2.24", "3.3.10", "3.3.13", "3.3.17", "3.4.3","3.4.13","3.5.0"]
for version in ["3.2.24", "3.3.17", "3.4.3","3.4.13","3.5.0"]
]
48 changes: 6 additions & 42 deletions etcd-manager/pkg/etcdversions/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,15 @@ import (
// on an inconsistent update

const (
Version_3_1_12 = "3.1.12"
Version_3_2_18 = "3.2.18"
Version_3_2_24 = "3.2.24"
Version_3_3_10 = "3.3.10"
Version_3_3_13 = "3.3.13"
Version_3_3_17 = "3.3.17"
Version_3_4_3 = "3.4.3"
Version_3_4_13 = "3.4.13"
Version_3_5_0 = "3.5.0"
)

var AllEtcdVersions = []string{
Version_3_1_12,
Version_3_2_18,
Version_3_2_24,
Version_3_3_10,
Version_3_3_13,
Version_3_3_17,
Version_3_4_3,
Version_3_4_13,
Expand Down Expand Up @@ -105,24 +97,10 @@ func EtcdVersionForAdoption(fromVersion string) string {

family := fmt.Sprintf("%d.%d", fromSemver.Major, fromSemver.Minor)
switch family {
case "3.0":
return Version_3_1_12
case "3.1":
return Version_3_1_12
case "3.2":
if fromSemver.Patch <= 18 {
return Version_3_2_18
} else {
return Version_3_2_24
}
case "3.0", "3.1", "3.2":
return Version_3_2_24
case "3.3":
if fromSemver.Patch <= 10 {
return Version_3_3_10
} else if fromSemver.Patch <= 13 {
return Version_3_3_13
} else {
return Version_3_3_17
}
return Version_3_3_17
case "3.4":
if fromSemver.Patch <= 3 {
return Version_3_4_3
Expand All @@ -145,24 +123,10 @@ func EtcdVersionForRestore(fromVersion string) string {

family := fmt.Sprintf("%d.%d", fromSemver.Major, fromSemver.Minor)
switch family {
case "3.0":
return Version_3_1_12
case "3.1":
return Version_3_1_12
case "3.2":
if fromSemver.Patch <= 18 {
return Version_3_2_18
} else {
return Version_3_2_24
}
case "3.0", "3.1", "3.2":
return Version_3_2_24
case "3.3":
if fromSemver.Patch <= 10 {
return Version_3_3_10
} else if fromSemver.Patch <= 13 {
return Version_3_3_13
} else {
return Version_3_3_17
}
return Version_3_3_17
case "3.4":
if fromSemver.Patch <= 3 {
return Version_3_4_3
Expand Down
8 changes: 0 additions & 8 deletions etcd-manager/test/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ go_test(
"resize_cluster_test.go",
],
data = [
"//:etcd-v3.1.12-linux-amd64_etcd",
"//:etcd-v3.1.12-linux-amd64_etcdctl",
"//:etcd-v3.2.18-linux-amd64_etcd",
"//:etcd-v3.2.18-linux-amd64_etcdctl",
"//:etcd-v3.2.24-linux-amd64_etcd",
"//:etcd-v3.2.24-linux-amd64_etcdctl",
"//:etcd-v3.3.10-linux-amd64_etcd",
"//:etcd-v3.3.10-linux-amd64_etcdctl",
"//:etcd-v3.3.13-linux-amd64_etcd",
"//:etcd-v3.3.13-linux-amd64_etcdctl",
"//:etcd-v3.3.17-linux-amd64_etcd",
"//:etcd-v3.3.17-linux-amd64_etcdctl",
"//:etcd-v3.4.13-linux-amd64_etcd",
Expand Down
8 changes: 0 additions & 8 deletions etcd-manager/test/integration/upgradedowngrade/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ go_test(
size = "enormous", # Takes more than 900 seconds to run on travis
srcs = ["upgradedowngrade_test.go"],
data = [
"//:etcd-v3.1.12-linux-amd64_etcd",
"//:etcd-v3.1.12-linux-amd64_etcdctl",
"//:etcd-v3.2.18-linux-amd64_etcd",
"//:etcd-v3.2.18-linux-amd64_etcdctl",
"//:etcd-v3.2.24-linux-amd64_etcd",
"//:etcd-v3.2.24-linux-amd64_etcdctl",
"//:etcd-v3.3.10-linux-amd64_etcd",
"//:etcd-v3.3.10-linux-amd64_etcdctl",
"//:etcd-v3.3.13-linux-amd64_etcd",
"//:etcd-v3.3.13-linux-amd64_etcdctl",
"//:etcd-v3.3.17-linux-amd64_etcd",
"//:etcd-v3.3.17-linux-amd64_etcdctl",
"//:etcd-v3.4.13-linux-amd64_etcd",
Expand Down

0 comments on commit 06f47e8

Please sign in to comment.