Skip to content

CNTRLPLANE-3035: test/e2e: migrate mutatingwebhook-ca-bundle-injection to OTE serial suite#335

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
wangke19:ote-migrate-mutatingwebhook-ca-bundle-injection
Mar 20, 2026
Merged

CNTRLPLANE-3035: test/e2e: migrate mutatingwebhook-ca-bundle-injection to OTE serial suite#335
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
wangke19:ote-migrate-mutatingwebhook-ca-bundle-injection

Conversation

@wangke19
Copy link
Copy Markdown
Contributor

@wangke19 wangke19 commented Mar 20, 2026

Summary

Migrates the mutatingwebhook-ca-bundle-injection test case to the OTE dual-mode framework, following the same pattern established in #332 and #334.

  • Adds testMutatingWebhookCABundleInjection(testing.TB), pollForMutatingWebhookConfigurationTB, and checkWebhookCABundleTB to e2e.go with [Operator][Serial] Ginkgo marker
  • Replaces the ~80-line inline body in e2e_test.go with a delegating call + NOTE comment
  • Removes now-dead pollForMutatingWebhookConfiguration helper from e2e_test.go
  • Retains admissionreg/admissionregclient imports and checkWebhookCABundle in e2e_test.go — still needed by the validatingwebhook test
  • Both update calls (corrupt + add-webhook) are wrapped in retry.RetryOnConflict with a fresh Get to avoid 409 conflicts from concurrent reconciliation

No [Disruptive] label needed — no CA rotation is triggered.

Relates to CNTRLPLANE-3000

…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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

Walkthrough

This pull request refactors mutating webhook CA bundle injection tests by moving implementation from eae_test.go to a new test framework in e2e.go. It introduces helper functions for CA bundle validation and polling, and consolidates duplicate test logic into a single testable function.

Changes

Cohort / File(s) Summary
New E2E Test Functions
test/e2e/e2e.go
Added serial e2e test mutatingwebhook-ca-bundle-injection with three new helpers: checkWebhookCABundleTB (validates CA bundles per webhook), pollForMutatingWebhookConfigurationTB (polls for CA bundle injection), and testMutatingWebhookCABundleInjection (core test logic handling webhook creation, CA bundle mutation, and restoration).
Test Refactoring
test/e2e/e2e_test.go
Removed pollForMutatingWebhookConfiguration helper and inline test logic; refactored mutatingwebhook-ca-bundle-injection subtest to delegate to new testMutatingWebhookCABundleInjection() function from e2e.go. Added note documenting temporary duplication.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from bertinatto and p0lyn0mial March 20, 2026 03:00
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 20, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between ae95e8a and 033c475.

📒 Files selected for processing (2)
  • test/e2e/e2e.go
  • test/e2e/e2e_test.go

Comment thread test/e2e/e2e.go
@wangke19 wangke19 changed the title test/e2e: migrate mutatingwebhook-ca-bundle-injection to OTE serial suite CNTRLPLANE-3035: test/e2e: migrate mutatingwebhook-ca-bundle-injection to OTE serial suite Mar 20, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 20, 2026

@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.

Details

In response to this:

Summary

Migrates the mutatingwebhook-ca-bundle-injection test case to the OTE dual-mode framework, following the same pattern established in #332 and #334.

  • Adds testMutatingWebhookCABundleInjection(testing.TB), pollForMutatingWebhookConfigurationTB, and checkWebhookCABundleTB to e2e.go with [Operator][Serial] Ginkgo marker
  • Replaces the ~80-line inline body in e2e_test.go with a delegating call + NOTE comment
  • Removes now-dead pollForMutatingWebhookConfiguration helper from e2e_test.go
  • Retains admissionreg/admissionregclient imports and checkWebhookCABundle in e2e_test.go — still needed by the validatingwebhook test
  • Both update calls (corrupt + add-webhook) are wrapped in retry.RetryOnConflict with a fresh Get to avoid 409 conflicts from concurrent reconciliation

No [Disruptive] label needed — no CA rotation is triggered.

Relates to CNTRLPLANE-3000

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 20, 2026

@wangke19: 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.

@gangwgr
Copy link
Copy Markdown

gangwgr commented Mar 20, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 20, 2026

[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

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

@wangke19
Copy link
Copy Markdown
Contributor Author

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@wangke19: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 87f886a into openshift:main Mar 20, 2026
12 checks passed
@wangke19 wangke19 deleted the ote-migrate-mutatingwebhook-ca-bundle-injection branch March 20, 2026 06:23
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. 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants