OCPBUGS-85580: Fix webhook TLS failure after service-ca to self-managed cert migration#8504
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe reconciler adds two constants: the Sequence Diagram(s)sequenceDiagram
autonumber
participant Controller as Controller
participant API as Kubernetes API
participant Mutating as MutatingWebhookConfiguration
participant Validating as ValidatingWebhookConfiguration
participant Secret as ServiceCA Secret
participant ServiceCA as service-ca Operator
Controller->>API: Get MutatingWebhookConfiguration (webhookConfigName)
API-->>Controller: MutatingWebhookConfiguration (may contain inject-cabundle)
Controller->>API: Get ValidatingWebhookConfiguration (webhookConfigName)
API-->>Controller: ValidatingWebhookConfiguration (may contain inject-cabundle)
Controller->>Mutating: Remove inject-cabundle annotation (if present)
Controller->>Validating: Remove inject-cabundle annotation (if present)
Controller->>API: Patch webhook configs CABundle
API-->>Controller: Patch result
Controller->>API: Delete service-ca managed Secret
API-->>Controller: Secret deleted
ServiceCA->>API: Would re-inject CABundle if annotation present
Note right of ServiceCA: Removing annotation prevents re-injection
🚥 Pre-merge checks | ✅ 10 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8504 +/- ##
==========================================
+ Coverage 37.53% 40.00% +2.46%
==========================================
Files 751 751
Lines 92026 92863 +837
==========================================
+ Hits 34544 37147 +2603
+ Misses 54841 53024 -1817
- Partials 2641 2692 +51
... and 53 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@joshbranham: This pull request references Jira Issue OCPBUGS-85580, 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. |
|
/jira refresh |
|
@joshbranham: This pull request references Jira Issue OCPBUGS-85580, which is invalid:
Comment 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. |
|
/jira refresh |
|
@joshbranham: This pull request references Jira Issue OCPBUGS-85580, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
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. |
cblecker
left a comment
There was a problem hiding this comment.
Fix looks correct — the annotation removal is well-placed within removeServiceCAResources and the ordering with respect to patchWebhookConfigsCABundle is sound. Nice catch on this one.
/lgtm
|
|
||
| mwc := &admissionregistrationv1.MutatingWebhookConfiguration{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: webhookConfigName, |
There was a problem hiding this comment.
nit: Since you introduced webhookConfigName, it might be worth updating the existing tests in this file to use it too — lines 184, 194, 213, and 218 still hardcode "hypershift.openshift.io". No big deal either way.
There was a problem hiding this comment.
Good call, silly robot missed that. Fixed, needs another lgtm if you are up for it.
|
Scheduling tests matching the |
Test Resultse2e-aws
e2e-aks
|
…figs during service-ca migration When upgrading from service-ca managed certs to self-managed certs, the reconciler removed the serving-cert-secret-name annotation from the Service but did not remove the inject-cabundle annotation from the MutatingWebhookConfiguration. This caused the service-ca operator to continuously overwrite the caBundle with its own CA, creating a mismatch with the self-managed serving certificate and breaking webhook TLS verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bc2224b to
b9fbac4
Compare
|
@joshbranham: This pull request references Jira Issue OCPBUGS-85580, which is valid. 3 validation(s) were run on this bug
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. |
|
/lgtm |
|
Scheduling tests matching the |
|
/test e2e-aws |
|
/approve |
|
@enxebre: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre, joshbranham 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 @joshbranham |
|
@enxebre: 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. |
|
@joshbranham: 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. |
|
@joshbranham: Jira Issue Verification Checks: Jira Issue OCPBUGS-85580 Jira Issue OCPBUGS-85580 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 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. |
|
@enxebre: new pull request created: #8513 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 kubernetes-sigs/prow repository. |
|
Fix included in release 5.0.0-0.nightly-2026-05-14-123934 |
Summary
WebhookCertReconcilerremoved theserving-cert-secret-nameannotation from the operator Service but did not remove theservice.beta.openshift.io/inject-cabundleannotation from theMutatingWebhookConfigurationopenshift-service-serving-signer), while the operator was serving with a certificate signed by the self-managed CA (hypershift-webhook-ca), resulting inx509: certificate signed by unknown authorityerrorsremoveInjectCABundleAnnotation()to strip the annotation from both Mutating and Validating webhook configurations during the service-ca migration pathTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests