Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
spiffxp committed Feb 17, 2021
1 parent 87a5e3a commit 5971a3a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions config/tests/jobs/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,14 +1086,16 @@ func TestSigReleaseMasterBlockingOrInformingJobsShouldUseFastBuilds(t *testing.T
}
}

// matches regex used by the "version" extractMode defined in kubetest/extract_k8s.go
var kubetestVersionExtractModeRegex = regexp.MustCompile(`^(v\d+\.\d+\.\d+[\w.\-+]*)$`)

// extractUsesCIBucket returns true if kubetest --extract=foo
// would use the value of --extract-ci-bucket, false otherwise
func extractUsesCIBucket(extract string) bool {
if strings.HasPrefix(extract, "ci/") || strings.HasPrefix(extract, "gci/") {
return true
}
re := regexp.MustCompile(`^(v\d+\.\d+\.\d+[\w.\-+]*)$`)
mat := re.FindStringSubmatch(extract)
mat := kubetestVersionExtractModeRegex.FindStringSubmatch(extract)
if mat != nil {
version := mat[1]
// non-gke versions that include a + are CI builds
Expand All @@ -1108,8 +1110,7 @@ func extractUsesReleaseBucket(extract string) bool {
if strings.HasPrefix(extract, "release/") {
return true
}
re := regexp.MustCompile(`^(v\d+\.\d+\.\d+[\w.\-+]*)$`)
mat := re.FindStringSubmatch(extract)
mat := kubetestVersionExtractModeRegex.FindStringSubmatch(extract)
if mat != nil {
version := mat[1]
// non-gke versions that lack a + are release builds
Expand Down

0 comments on commit 5971a3a

Please sign in to comment.