Skip to content

CNTRLPLANE-3038: test/e2e: migrate validatingwebhook-ca-bundle-injection to OTE serial suite#336

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

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

Conversation

@wangke19
Copy link
Copy Markdown
Contributor

@wangke19 wangke19 commented Mar 20, 2026

Summary

Migrates the validatingwebhook-ca-bundle-injection test case to the OTE dual-mode framework — the final case in the CA bundle injection series (#332, #334, #335).

  • Adds testValidatingWebhookCABundleInjection(testing.TB) and pollForValidatingWebhookConfigurationTB 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 pollForValidatingWebhookConfiguration and checkWebhookCABundle helpers from e2e_test.go
  • With both webhook tests now migrated, the shared webhookClientConfig/sideEffectNone variables and admissionreg/admissionregclient imports are also removed from e2e_test.go
  • 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

… suite

Add testValidatingWebhookCABundleInjection(testing.TB) and
pollForValidatingWebhookConfigurationTB 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 pollForValidatingWebhookConfiguration
and checkWebhookCABundle helpers. With both webhook tests migrated, the
shared webhookClientConfig/sideEffectNone variables and the
admissionreg/admissionregclient imports are also removed.

Both update calls (corrupt + add-webhook) are wrapped in
retry.RetryOnConflict with a fresh Get inside the closure to avoid 409
conflicts from concurrent reconciliation.

Relates to CNTRLPLANE-3000
@openshift-ci openshift-ci Bot requested review from bertinatto and p0lyn0mial March 20, 2026 08:35
@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
@wangke19 wangke19 changed the title test/e2e: migrate validatingwebhook-ca-bundle-injection to OTE serial suite CNTRLPLANE-3038: test/e2e: migrate validatingwebhook-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-3038 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 validatingwebhook-ca-bundle-injection test case to the OTE dual-mode framework — the final case in the CA bundle injection series (#332, #334, #335).

  • Adds testValidatingWebhookCABundleInjection(testing.TB) and pollForValidatingWebhookConfigurationTB 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 pollForValidatingWebhookConfiguration and checkWebhookCABundle helpers from e2e_test.go
  • With both webhook tests now migrated, the shared webhookClientConfig/sideEffectNone variables and admissionreg/admissionregclient imports are also removed from e2e_test.go
  • 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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64f47da3-36c6-4fd5-8f47-7c87e31fcde8

📥 Commits

Reviewing files that changed from the base of the PR and between 87f886a and 9155c5d.

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

Walkthrough

Changes refactor validating webhook CA bundle injection testing by extracting inline test logic from e2e_test.go into dedicated functions (testValidatingWebhookCABundleInjection, pollForValidatingWebhookConfigurationTB) in e2e.go, reorganizing test structure while preserving functionality.

Changes

Cohort / File(s) Summary
E2E Test Refactoring
test/e2e/e2e.go
Introduced polling helper pollForValidatingWebhookConfigurationTB and test function testValidatingWebhookCABundleInjection that creates a ValidatingWebhookConfiguration, injects CA bundles, mutates and validates restoration, appends webhooks, and verifies CA bundle presence across all webhooks using retry.RetryOnConflict.
E2E Test Refactoring
test/e2e/e2e_test.go
Removed inline test helpers pollForValidatingWebhookConfiguration and checkWebhookCABundle, deleted validation logic from TestE2E, replaced with delegation to testValidatingWebhookCABundleInjection(t), and removed admissionregistration-related imports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 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
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.

@wangke19
Copy link
Copy Markdown
Contributor Author

/verified by CI

@gangwgr
Copy link
Copy Markdown

gangwgr commented Mar 20, 2026

/lgtm

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

@openshift-merge-bot openshift-merge-bot Bot merged commit 9c06039 into openshift:main Mar 20, 2026
12 checks passed
@wangke19 wangke19 deleted the ote-migrate-validatingwebhook-ca-bundle-injection branch March 20, 2026 11:52
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