Skip to content

OCPBUGS-137453: Fix ci/prow/unit envtest provisioning on release-4.15 - #536

Open
redhat-chai-bot wants to merge 1 commit into
openshift:release-4.15from
redhat-chai-bot:OCPBUGS-137453-envtest-gcs-fix
Open

redhat-chai-bot wants to merge 1 commit into
openshift:release-4.15from
redhat-chai-bot:OCPBUGS-137453-envtest-gcs-fix

Conversation

@redhat-chai-bot

Copy link
Copy Markdown
Contributor

Problem

ci/prow/unit fails 100% of the time on release-4.15 (and release-4.16). All envtest-backed tests fail before they can run with:

exec: "kube-apiserver": executable file not found in $PATH

The unit Makefile target resolves KUBEBUILDER_ASSETS by invoking the vendored setup-envtest (sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230216140739-..., controller-runtime v0.16.2). That old setup-envtest downloads envtest binaries by listing the legacy kubebuilder-tools GCS bucket, which no longer serves unauthenticated listing and now returns HTTP 401. The setup-envtest use call therefore fails, KUBEBUILDER_ASSETS resolves to empty, and kube-apiserver/etcd are absent from $PATH.

release-4.17+ are unaffected because they use a newer setup-envtest that fetches assets from the controller-tools GitHub releases index. That approach is not back-portable here: the newer setup-envtest requires Go >= 1.22, while this branch builds with Go 1.20, and the old vendored setup-envtest cannot 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 the kubernetes-sigs/controller-tools GitHub releases (resolved via the envtest-releases.yaml index), verifies it against the published sha512, extracts etcd/kube-apiserver/kubectl into the local bin/ dir, and prints that directory for the Makefile to feed into KUBEBUILDER_ASSETS.

This keeps the change self-contained:

  • No go.mod/vendor changes and no toolchain bump — safe on the Go 1.20 builder.
  • No application/product code changes; this is a CI/test-infra fix only.

Changes

  • New hack/setup-envtest-assets.sh: resolves the newest v1.28.x from the index, verifies the download with sha512sum --check (fails hard on mismatch), extracts the binaries, caches on re-run, and prints only the bin dir to stdout (diagnostics to stderr).
  • Makefile unit target: sources KUBEBUILDER_ASSETS from ./hack/setup-envtest-assets.sh $(ENVTEST_K8S_VERSION) $(PROJECT_DIR)/bin instead of $(ENVTEST) use ....

Validation

make unit now exits 0 with envtest provisioned (kube-apiserver reports Kubernetes v1.28.3, no executable file not found in $PATH):

  • --- PASS: TestPartialRestMapperProvider (pkg/restmapper)
  • pkg/controllers Ginkgo suite: 55 Passed | 0 Failed
  • pkg/controllers/resourceapply: TestApplyConfigMap, TestApplyDeployment, TestApplyDaemonSet, TestApplyPDB all pass
  • Overall: Test Suite Passed

Note

The same fix applies to release-4.16; a matching PR can follow.


AI-generated. Review for accuracy.

@jkaurredhat requested from Slack

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>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-137453, which is invalid:

  • expected the bug to target the "4.15.z" version, but no target version was set
  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected Jira Issue OCPBUGS-137453 to depend on a bug targeting a version in 4.16.0, 4.16.z and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Problem

ci/prow/unit fails 100% of the time on release-4.15 (and release-4.16). All envtest-backed tests fail before they can run with:

exec: "kube-apiserver": executable file not found in $PATH

The unit Makefile target resolves KUBEBUILDER_ASSETS by invoking the vendored setup-envtest (sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230216140739-..., controller-runtime v0.16.2). That old setup-envtest downloads envtest binaries by listing the legacy kubebuilder-tools GCS bucket, which no longer serves unauthenticated listing and now returns HTTP 401. The setup-envtest use call therefore fails, KUBEBUILDER_ASSETS resolves to empty, and kube-apiserver/etcd are absent from $PATH.

release-4.17+ are unaffected because they use a newer setup-envtest that fetches assets from the controller-tools GitHub releases index. That approach is not back-portable here: the newer setup-envtest requires Go >= 1.22, while this branch builds with Go 1.20, and the old vendored setup-envtest cannot 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 the kubernetes-sigs/controller-tools GitHub releases (resolved via the envtest-releases.yaml index), verifies it against the published sha512, extracts etcd/kube-apiserver/kubectl into the local bin/ dir, and prints that directory for the Makefile to feed into KUBEBUILDER_ASSETS.

This keeps the change self-contained:

  • No go.mod/vendor changes and no toolchain bump — safe on the Go 1.20 builder.
  • No application/product code changes; this is a CI/test-infra fix only.

Changes

  • New hack/setup-envtest-assets.sh: resolves the newest v1.28.x from the index, verifies the download with sha512sum --check (fails hard on mismatch), extracts the binaries, caches on re-run, and prints only the bin dir to stdout (diagnostics to stderr).
  • Makefile unit target: sources KUBEBUILDER_ASSETS from ./hack/setup-envtest-assets.sh $(ENVTEST_K8S_VERSION) $(PROJECT_DIR)/bin instead of $(ENVTEST) use ....

Validation

make unit now exits 0 with envtest provisioned (kube-apiserver reports Kubernetes v1.28.3, no executable file not found in $PATH):

  • --- PASS: TestPartialRestMapperProvider (pkg/restmapper)
  • pkg/controllers Ginkgo suite: 55 Passed | 0 Failed
  • pkg/controllers/resourceapply: TestApplyConfigMap, TestApplyDeployment, TestApplyDaemonSet, TestApplyPDB all pass
  • Overall: Test Suite Passed

Note

The same fix applies to release-4.16; a matching PR can follow.


AI-generated. Review for accuracy.

@jkaurredhat requested from Slack

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.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 8e7f8b35-5979-4f6c-8df2-ce1ad42a3afe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

@openshift-ci
openshift-ci Bot requested review from damdo and racheljpg November 4, 2026 22:28
@redhat-chai-bot

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-137453, which is invalid:

  • expected Jira Issue OCPBUGS-137453 to depend on a bug targeting a version in 4.16.0, 4.16.z and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

/jira refresh

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.

@nindsimonv

Copy link
Copy Markdown

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade

@redhat-chai-bot

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-upgrade

3 similar comments
@redhat-chai-bot

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-upgrade

@nindsimonv

Copy link
Copy Markdown

/test e2e-aws-ovn-upgrade

@nindsimonv

Copy link
Copy Markdown

/test e2e-aws-ovn-upgrade

@damdo damdo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 9, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade

@openshift-ci

openshift-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: damdo
Once this PR has been reviewed and has the lgtm label, please assign nrb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@redhat-chai-bot

Copy link
Copy Markdown
Contributor Author

/retest-required

The e2e-aws-ovn failure is unrelated to this change — this PR only modifies unit-test envtest provisioning (hack/setup-envtest-assets.sh + the Makefile unit target), and ci/prow/unit is green. e2e-aws-ovn-upgrade passed on the same commit, so this is the known 4.15 e2e-aws-ovn infra flake. Retesting the required suite.


Chai persona: Sustaining OCP

AI-generated. Review for accuracy.

@openshift-ci

openshift-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@jkaurredhat

Copy link
Copy Markdown

/label backport-risk-assessed
/label approved

@openshift-ci openshift-ci Bot added backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants