Repository navigation
OCPBUGS-137453: Fix ci/prow/unit envtest provisioning on release-4.15 - #536
redhat-chai-bot wants to merge 1 commit into
Conversation
The `unit` make target provisioned envtest binaries via the vendored
setup-envtest, which lists the legacy `kubebuilder-tools` GCS bucket.
That bucket now returns HTTP 401 for unauthenticated listing, so
`setup-envtest use` fails, KUBEBUILDER_ASSETS resolves to empty, and
kube-apiserver/etcd are missing ("exec: kube-apiserver: executable file
not found in $PATH"), failing every envtest-backed unit test.
Replace the setup-envtest call with hack/setup-envtest-assets.sh, which
downloads the envtest asset bundle for ENVTEST_K8S_VERSION from the
kubernetes-sigs/controller-tools GitHub releases (resolved via the
envtest-releases.yaml index), verifies its sha512 checksum, extracts the
binaries into the bin dir, and prints that dir for KUBEBUILDER_ASSETS.
This avoids the dead GCS listing without bumping setup-envtest (which
would require Go >= 1.22, incompatible with this branch's Go 1.20).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-137453, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
/jira refresh |
|
@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-137453, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/pipeline required |
|
Scheduling tests matching the |
|
/test e2e-aws-ovn-upgrade |
3 similar comments
|
/test e2e-aws-ovn-upgrade |
|
/test e2e-aws-ovn-upgrade |
|
/test e2e-aws-ovn-upgrade |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: damdo The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest-required The Chai persona: AI-generated. Review for accuracy. |
|
@redhat-chai-bot: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/label backport-risk-assessed |
Problem
ci/prow/unitfails 100% of the time onrelease-4.15(andrelease-4.16). All envtest-backed tests fail before they can run with:The
unitMakefile target resolvesKUBEBUILDER_ASSETSby invoking the vendoredsetup-envtest(sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230216140739-..., controller-runtime v0.16.2). That oldsetup-envtestdownloads envtest binaries by listing the legacykubebuilder-toolsGCS bucket, which no longer serves unauthenticated listing and now returnsHTTP 401. Thesetup-envtest usecall therefore fails,KUBEBUILDER_ASSETSresolves to empty, andkube-apiserver/etcdare absent from$PATH.release-4.17+ are unaffected because they use a newersetup-envtestthat fetches assets from the controller-tools GitHub releases index. That approach is not back-portable here: the newersetup-envtestrequires Go >= 1.22, while this branch builds with Go 1.20, and the old vendoredsetup-envtestcannot parse the new asset naming used by the mirror bucket.Fix
Provision envtest binaries without the dead GCS listing. A small helper script downloads the envtest asset bundle for
ENVTEST_K8S_VERSION(1.28) from thekubernetes-sigs/controller-toolsGitHub releases (resolved via theenvtest-releases.yamlindex), verifies it against the publishedsha512, extractsetcd/kube-apiserver/kubectlinto the localbin/dir, and prints that directory for the Makefile to feed intoKUBEBUILDER_ASSETS.This keeps the change self-contained:
go.mod/vendor changes and no toolchain bump — safe on the Go 1.20 builder.Changes
hack/setup-envtest-assets.sh: resolves the newestv1.28.xfrom the index, verifies the download withsha512sum --check(fails hard on mismatch), extracts the binaries, caches on re-run, and prints only the bin dir to stdout (diagnostics to stderr).Makefileunittarget: sourcesKUBEBUILDER_ASSETSfrom./hack/setup-envtest-assets.sh $(ENVTEST_K8S_VERSION) $(PROJECT_DIR)/bininstead of$(ENVTEST) use ....Validation
make unitnow exits 0 with envtest provisioned (kube-apiserverreportsKubernetes v1.28.3, noexecutable file not found in $PATH):--- PASS: TestPartialRestMapperProvider(pkg/restmapper)pkg/controllersGinkgo suite:55 Passed | 0 Failedpkg/controllers/resourceapply:TestApplyConfigMap,TestApplyDeployment,TestApplyDaemonSet,TestApplyPDBall passTest Suite PassedNote
The same fix applies to
release-4.16; a matching PR can follow.AI-generated. Review for accuracy.
@jkaurredhat requested from Slack