Merge pull request #63504 from dims/improve-where-we-load-build-versions-for-kubeadm-upgrade-jobs

Automatic merge from submit-queue (batch tested with PRs 62850, 63504). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve where we load builds from for kubeadm upgrade jobs

**What this PR does / why we need it**:

For 1.8,1.9,1.10 branches, we need to load the latest
version from ci/latest*.txt.

For master, we need to load the version number from
ci-cross/latest.txt

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
```


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubernetes/issues/61483

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixed where we get latest builds for stable branches
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-09 12:27:18 -07:00 committed by GitHub
commit c94efcea1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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"
}

View File

@ -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.