Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/tests/jobs: add check for use of k8s-release-dev bucket #19871

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/jobs/kubernetes/sig-cli/sig-cli-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ periodics:
- --check-leaked-resources
- --check-version-skew=false
- --extract=ci/k8s-stable1
- --extract=ci/latest-fast
- --extract=ci/latest
- --gcp-node-image=gci
- --gcp-zone=us-west1-b
- --provider=gce
Expand Down
26 changes: 25 additions & 1 deletion config/tests/jobs/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1131,10 +1131,34 @@ func TestSigReleaseMasterBlockingOrInformingJobsShouldUseFastBuilds(t *testing.T
for _, arg := range job.Spec.Containers[0].Args {
if strings.HasPrefix(arg, "--extract=") {
extract = strings.TrimPrefix(arg, "--extract=")
if extract == "ci/latest" {
if extract != "ci/latest-fast" {
t.Errorf("%s: release-master-blocking e2e jobs must use --extract=ci/latest-fast, found --extract=ci/latest instead", job.Name)
}
}
}
}
}

// To help with migration to community-owned buckets for CI and release artifacts:
// - jobs extracting from kubernetes-release-dev should use k8s-release-dev instead
func TestKubernetesE2eJobsMustExtractFromK8sInfraBuckets(t *testing.T) {
jobs := allStaticJobs()
for _, job := range jobs {
extract := ""
extractCIBucket := "kubernetes-release-dev"
for _, arg := range job.Spec.Containers[0].Args {
if strings.HasPrefix(arg, "--extract=") {
extract = strings.TrimPrefix(arg, "--extract=")
}
if strings.HasPrefix(arg, "--extract-ci-bucket=") {
extractCIBucket = strings.TrimPrefix(arg, "--extract-ci-bucket=")
}
}
if strings.HasPrefix(extract, "ci/") && extractCIBucket != "k8s-release-dev" {
// TODO(https://github.com/kubernetes/test-infra/issues/19484): widen to all ci/ extracts once ci-kubernetes-build migrated
if extract == "ci/latest-fast" {
t.Errorf("FAIL - %s: jobs using --extract=%s must have --extract-ci-bucket=k8s-release-dev", job.Name, extract)
}
}
}
}