From ff26e57ba6713af9462e26e042d479006c15a0cc Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Mon, 7 May 2018 15:56:07 -0400 Subject: [PATCH] Improve where we load builds from for kubeadm upgrade jobs We should stop special casing "ci-cross" and just use the configuration in test-infra to dictate where we pick up the builds from. For 1.8,1.9,1.10 branches, we need to load the latest version from ci/latest*.txt. For master, 1.11 etc, we need to load from ci-cross/latest*.txt. We need to update test-infra configs if things fail. try these to verify: ``` gsutil cat gs://kubernetes-release-dev/ci/latest-1.9.txt gsutil cat gs://kubernetes-release-dev/ci-cross/latest.txt ``` --- cmd/kubeadm/app/util/version.go | 4 ++-- cmd/kubeadm/app/util/version_test.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/kubeadm/app/util/version.go b/cmd/kubeadm/app/util/version.go index b64857b61c1..286d0348e58 100644 --- a/cmd/kubeadm/app/util/version.go +++ b/cmd/kubeadm/app/util/version.go @@ -122,8 +122,8 @@ func splitVersion(version string) (string, string, error) { switch { case strings.HasPrefix(subs[0][2], "ci"): - // Special case. CI images populated only by ci-cross area - urlSuffix = "ci-cross" + // Just use whichever the user specified + urlSuffix = subs[0][2] default: urlSuffix = "release" } diff --git a/cmd/kubeadm/app/util/version_test.go b/cmd/kubeadm/app/util/version_test.go index 23591d2cf4b..017f25936a3 100644 --- a/cmd/kubeadm/app/util/version_test.go +++ b/cmd/kubeadm/app/util/version_test.go @@ -180,8 +180,10 @@ func TestSplitVersion(t *testing.T) { {"release/v1.7.0", "https://dl.k8s.io/release", "v1.7.0", true}, {"release/latest-1.7", "https://dl.k8s.io/release", "latest-1.7", true}, // CI builds area, lookup actual builds at ci-cross/*.txt + {"ci/latest", "https://dl.k8s.io/ci", "latest", true}, {"ci-cross/latest", "https://dl.k8s.io/ci-cross", "latest", true}, - {"ci/latest-1.7", "https://dl.k8s.io/ci-cross", "latest-1.7", true}, + {"ci/latest-1.7", "https://dl.k8s.io/ci", "latest-1.7", true}, + {"ci-cross/latest-1.7", "https://dl.k8s.io/ci-cross", "latest-1.7", true}, // unknown label in default (release) area: splitVersion validate only areas. {"unknown-1", "https://dl.k8s.io/release", "unknown-1", true}, // unknown area, not valid input.