diff --git a/config/jobs/kubernetes/generated/generated.yaml b/config/jobs/kubernetes/generated/generated.yaml index a60a14b9b1dd..0b48ce1152eb 100644 --- a/config/jobs/kubernetes/generated/generated.yaml +++ b/config/jobs/kubernetes/generated/generated.yaml @@ -644,6 +644,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -690,6 +691,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -736,6 +738,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -775,6 +778,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -815,6 +819,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -855,6 +860,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -894,6 +900,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -934,6 +941,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -974,6 +982,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1013,6 +1022,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1053,6 +1063,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1093,6 +1104,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1132,6 +1144,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1172,6 +1185,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1212,6 +1226,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1251,6 +1266,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1291,6 +1307,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1331,6 +1348,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1370,6 +1388,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1410,6 +1429,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1450,6 +1470,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1489,6 +1510,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1529,6 +1551,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1569,6 +1592,7 @@ periodics: - --image-project=ubuntu-os-gke-cloud-devel - --gcp-node-image=custom - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1607,6 +1631,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --test_args=--ginkgo.focus=\[Feature:Reboot\] --minStartupPods=8 env: @@ -1642,6 +1667,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Feature:Ingress\] --minStartupPods=8 env: @@ -1677,6 +1703,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1716,6 +1743,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1753,6 +1781,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1791,6 +1820,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --env=KUBE_PROXY_DAEMONSET=true - --env=ENABLE_POD_PRIORITY=true @@ -1831,6 +1861,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --test_args=--ginkgo.focus=\[Feature:Reboot\] --minStartupPods=8 env: @@ -1866,6 +1897,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Feature:Ingress\] --minStartupPods=8 env: @@ -1901,6 +1933,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -1940,6 +1973,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -1977,6 +2011,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -2015,6 +2050,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --env=KUBE_PROXY_DAEMONSET=true - --env=ENABLE_POD_PRIORITY=true @@ -2055,6 +2091,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --test_args=--ginkgo.focus=\[Feature:Reboot\] --minStartupPods=8 env: @@ -2090,6 +2127,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Feature:Ingress\] --minStartupPods=8 env: @@ -2125,6 +2163,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -2163,6 +2202,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -2200,6 +2240,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -2238,6 +2279,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --env=KUBE_PROXY_DAEMONSET=true - --env=ENABLE_POD_PRIORITY=true @@ -2278,6 +2320,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Feature:Ingress\] --minStartupPods=8 env: @@ -2313,6 +2356,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --test_args=--ginkgo.focus=\[Feature:Reboot\] --minStartupPods=8 env: @@ -2348,6 +2392,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=120m - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -2386,6 +2431,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=660m - --test_args=--ginkgo.focus=\[Serial\]|\[Disruptive\] --ginkgo.skip=\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=1 @@ -2423,6 +2469,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=150m - --test_args=--ginkgo.focus=\[Slow\] --ginkgo.skip=\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 - --ginkgo-parallel=30 @@ -2461,6 +2508,7 @@ periodics: - --gcp-zone=us-west1-b - --gcp-node-image=gci - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev - --timeout=180m - --test_args=--ginkgo.focus=\[Feature:(ExternalTrafficLocalOnly|DynamicKubeletConfig)\] --minStartupPods=8 - --env=KUBE_PROXY_DAEMONSET=true diff --git a/config/jobs/kubernetes/sig-cli/sig-cli-config.yaml b/config/jobs/kubernetes/sig-cli/sig-cli-config.yaml index a0b12ae8e817..1de72a2f0b42 100644 --- a/config/jobs/kubernetes/sig-cli/sig-cli-config.yaml +++ b/config/jobs/kubernetes/sig-cli/sig-cli-config.yaml @@ -161,6 +161,7 @@ periodics: - --check-version-skew=false - --extract=ci/k8s-stable1 - --extract=ci/latest + - --extract-ci-bucket=k8s-release-dev - --gcp-node-image=gci - --gcp-zone=us-west1-b - --ginkgo-parallel=25 diff --git a/config/jobs/kubernetes/sig-release/release-branch-jobs/1.18.yaml b/config/jobs/kubernetes/sig-release/release-branch-jobs/1.18.yaml index 7e2a91073a05..597acb056b4b 100644 --- a/config/jobs/kubernetes/sig-release/release-branch-jobs/1.18.yaml +++ b/config/jobs/kubernetes/sig-release/release-branch-jobs/1.18.yaml @@ -24,6 +24,7 @@ periodics: - --check-version-skew=false - --extract=ci/k8s-stable2 - --extract=ci/latest + - --extract-ci-bucket=k8s-release-dev - --gcp-node-image=gci - --gcp-zone=us-west1-b - --ginkgo-parallel=25 @@ -61,6 +62,7 @@ periodics: - --scenario=kubernetes_e2e - -- - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --gcp-master-image=gci - --gcp-node-image=gci - --gcp-zone=us-west1-b @@ -100,6 +102,7 @@ periodics: - -- - --check-leaked-resources - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --env=KUBE_CONTAINER_RUNTIME=docker - --gcp-node-image=gci - --gcp-project-type=gpu-project @@ -359,6 +362,7 @@ periodics: - --check-leaked-resources - --cluster=e2e-big - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev - --gcp-node-image=gci - --gcp-nodes=100 - --gcp-project-type=scalability-project diff --git a/config/jobs/kubernetes/sig-release/release-branch-jobs/1.19.yaml b/config/jobs/kubernetes/sig-release/release-branch-jobs/1.19.yaml index 790de61bf686..8593c17ecc90 100644 --- a/config/jobs/kubernetes/sig-release/release-branch-jobs/1.19.yaml +++ b/config/jobs/kubernetes/sig-release/release-branch-jobs/1.19.yaml @@ -20,6 +20,7 @@ periodics: - --scenario=kubernetes_e2e - -- - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --gcp-master-image=gci - --gcp-node-image=gci - --gcp-zone=us-west1-b @@ -59,6 +60,7 @@ periodics: - -- - --check-leaked-resources - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --env=KUBE_CONTAINER_RUNTIME=docker - --gcp-node-image=gci - --gcp-project-type=gpu-project @@ -315,6 +317,7 @@ periodics: - --check-leaked-resources - --cluster=e2e-big - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev - --gcp-node-image=gci - --gcp-nodes=100 - --gcp-project-type=scalability-project diff --git a/config/tests/jobs/jobs_test.go b/config/tests/jobs/jobs_test.go index a77791c03db4..14a17d94b951 100644 --- a/config/tests/jobs/jobs_test.go +++ b/config/tests/jobs/jobs_test.go @@ -1086,28 +1086,115 @@ 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 + } + mat := kubetestVersionExtractModeRegex.FindStringSubmatch(extract) + if mat != nil { + version := mat[1] + // non-gke versions that include a + are CI builds + return !strings.Contains(version, "-gke.") && strings.Contains(version, "+") + } + return false +} + +// extractUsesReleaseBucket returns true if kubetest --extract=foo +// would use the value of --extract-release-bucket, false otherwise +func extractUsesReleaseBucket(extract string) bool { + if strings.HasPrefix(extract, "release/") { + return true + } + mat := kubetestVersionExtractModeRegex.FindStringSubmatch(extract) + if mat != nil { + version := mat[1] + // non-gke versions that lack a + are release builds + return !strings.Contains(version, "-gke.") && !strings.Contains(version, "+") + } + return false +} + // 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 +// - jobs using --extract=ci/latest-fast MUST pull from gs://k8s-release-dev +// - release-blocking jobs using --extract=ci/* MUST from pull gs://k8s-release-dev +// TODO(https://github.com/kubernetes/k8s.io/issues/846): switch from SHOULD to MUST once all jobs migrated +// - jobs using --extract=ci/* SHOULD pull from gs://k8s-release-dev +// TODO(https://github.com/kubernetes/k8s.io/issues/1569): start warning once gs://k8s-release populated +// - jobs using --extract=release/* SHOULD pull from gs://k8s-release func TestKubernetesE2eJobsMustExtractFromK8sInfraBuckets(t *testing.T) { jobs := allStaticJobs() + var totalJobs, needsFixJobs int 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=") + needsFix := false + extracts := []string{} + const ( + defaultCIBucket = "kubernetes-release-dev" // ensure this matches kubetest --extract-ci-bucket default + expectedCIBucket = "k8s-release-dev" + defaultReleaseBucket = "kubernetes-release" // ensure this matches kubetest --extract-release-bucket default + expectedReleaseBucket = "k8s-release" + k8sReleaseIsPopulated = false // TODO(kubernetes/k8s.io#1569): drop this once gs://k8s-release populated + ) + ciBucket := defaultCIBucket + releaseBucket := defaultReleaseBucket + for _, container := range job.Spec.Containers { + for _, arg := range container.Args { + if strings.HasPrefix(arg, "--extract=") { + extracts = append(extracts, strings.TrimPrefix(arg, "--extract=")) + } + if strings.HasPrefix(arg, "--extract-ci-bucket=") { + ciBucket = strings.TrimPrefix(arg, "--extract-ci-bucket=") + } + if strings.HasPrefix(arg, "--extract-release-bucket=") { + releaseBucket = strings.TrimPrefix(arg, "--extract-release-bucket=") + } } - if strings.HasPrefix(arg, "--extract-ci-bucket=") { - extractCIBucket = strings.TrimPrefix(arg, "--extract-ci-bucket=") + for _, extract := range extracts { + fail := false + if extractUsesCIBucket(extract) && ciBucket != expectedCIBucket { + needsFix = true + jobDesc := "jobs" + fail = extract == "ci/latest-fast" + if isKubernetesReleaseBlocking(job) { + fail = true + jobDesc = "release-blocking jobs" + } + msg := fmt.Sprintf("%s: %s using --extract=%s must have --extract-ci-bucket=%s", job.Name, jobDesc, extract, expectedCIBucket) + if fail { + t.Errorf("FAIL - %s", msg) + } else { + t.Logf("WARN - %s", msg) + } + } + if k8sReleaseIsPopulated && extractUsesReleaseBucket(extract) && releaseBucket != expectedReleaseBucket { + needsFix = true + jobDesc := "jobs" + if isKubernetesReleaseBlocking(job) { + fail = true + jobDesc = "release-blocking jobs" + } + fail := isKubernetesReleaseBlocking(job) + msg := fmt.Sprintf("%s: %s using --extract=%s must have --extract-release-bucket=%s", job.Name, jobDesc, extract, expectedCIBucket) + if fail { + t.Errorf("FAIL - %s", msg) + } else { + t.Logf("WARN - %s", msg) + } + } } } - 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) - } + totalJobs++ + if needsFix { + needsFixJobs++ } } + if needsFixJobs > 0 { + t.Logf("%4d/%4d jobs should be updated to pull from community-owned gcs buckets", needsFixJobs, totalJobs) + } } // Prow jobs should use pod-utils instead of relying on bootstrap diff --git a/releng/test_config.yaml b/releng/test_config.yaml index 4c8b41d8b89a..6e6810439452 100644 --- a/releng/test_config.yaml +++ b/releng/test_config.yaml @@ -522,22 +522,27 @@ k8sVersions: dev: args: - --extract=ci/latest + - --extract-ci-bucket=k8s-release-dev version: master beta: args: - --extract=ci/latest-1.20 + - --extract-ci-bucket=k8s-release-dev version: '1.20' stable1: args: - --extract=ci/latest-1.19 + - --extract-ci-bucket=k8s-release-dev version: '1.19' stable2: args: - --extract=ci/latest-1.18 + - --extract-ci-bucket=k8s-release-dev version: '1.18' stable3: args: - --extract=ci/latest-1.17 + - --extract-ci-bucket=k8s-release-dev version: '1.17' testSuites: