CNTRLPLANE-3035: test/e2e: migrate mutatingwebhook-ca-bundle-injection to OTE serial suite#335
Conversation
…uite Add testMutatingWebhookCABundleInjection(testing.TB), pollForMutatingWebhookConfigurationTB, and checkWebhookCABundleTB to e2e.go so the test runs under both the standard `go test` runner and the OTE Ginkgo suite via [Operator][Serial]. In e2e_test.go, replace the inline test body with a call to the shared function and remove the now-dead pollForMutatingWebhookConfiguration helper. The admissionreg/admissionregclient imports and checkWebhookCABundle helper are retained as they are still used by the validatingwebhook test. Both update calls are wrapped in retry.RetryOnConflict with a fresh Get inside the closure to avoid 409 conflicts from concurrent reconciliation. Relates to CNTRLPLANE-3000
WalkthroughThis pull request refactors mutating webhook CA bundle injection tests by moving implementation from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/e2e/e2e.go`:
- Around line 2117-2134: pollForMutatingWebhookConfigurationTB currently only
validates CABundles for whatever webhooks exist and can miss that the newly
appended webhook was dropped; update pollForMutatingWebhookConfigurationTB to
also assert the presence of the newly added webhook by adding an
expectedWebhookName (or expectedWebhookNames) parameter and, inside the polling
closure (where it iterates webhookConfig.Webhooks and calls
checkWebhookCABundleTB), ensure one of the webhooks has the expected name and
matching CABundle (return an error if not found), and apply the same
presence-check change to the analogous function used at the other location
mentioned.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a116155a-8a24-49a4-ac1b-5f57955f17be
📒 Files selected for processing (2)
test/e2e/e2e.gotest/e2e/e2e_test.go
|
@wangke19: This pull request references CNTRLPLANE-3035 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.22.0" version, but no target version was set. 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. |
|
@wangke19: 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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gangwgr, wangke19 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by CI |
|
@wangke19: This PR has been marked as verified by 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. |
Summary
Migrates the
mutatingwebhook-ca-bundle-injectiontest case to the OTE dual-mode framework, following the same pattern established in #332 and #334.testMutatingWebhookCABundleInjection(testing.TB),pollForMutatingWebhookConfigurationTB, andcheckWebhookCABundleTBtoe2e.gowith[Operator][Serial]Ginkgo markere2e_test.gowith a delegating call + NOTE commentpollForMutatingWebhookConfigurationhelper frome2e_test.goadmissionreg/admissionregclientimports andcheckWebhookCABundleine2e_test.go— still needed by the validatingwebhook testretry.RetryOnConflictwith a freshGetto avoid 409 conflicts from concurrent reconciliationNo
[Disruptive]label needed — no CA rotation is triggered.Relates to CNTRLPLANE-3000