Bug OCPBUGS-112464: Add x509/TLS errors to IsApplyErrorRetriable - #6432
Bug OCPBUGS-112464: Add x509/TLS errors to IsApplyErrorRetriable#6432redhat-chai-bot wants to merge 1 commit into
Conversation
During cluster upgrades, the kube-apiserver may briefly serve a certificate that does not include the kubernetes service ClusterIP as an IP SAN. This causes transient x509/TLS certificate validation errors that self-heal within seconds once the new serving cert is issued. Add string-based matching for "x509:" and "tls: failed to verify certificate" error patterns to the retry predicate, consistent with the existing "rpc error" string match. Also add a corresponding unit test covering x509, TLS, wrapped, and negative cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-112464, 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough
ChangesApply Error Retry Handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change retries transient x509/TLS certificate errors and adds focused coverage; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: redhat-chai-bot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest ci/prow/bootstrap-unit AI-generated. Review for accuracy. |
|
/pipeline required |
|
Scheduling tests matching the |
|
/test bootstrap-unit AI-generated. Review for accuracy. |
|
/retest-required AI-generated. Review for accuracy. |
|
/retest-required The two remaining failures are unrelated to this change:
AI-generated. Review for accuracy. |
|
@redhat-chai-bot: The following tests failed, say
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. |
Summary
During cluster upgrades, the MCO briefly goes Degraded with
MachineConfigServerFailedbecauseIsApplyErrorRetriabledoes not consider x509/TLS certificate errors as retriable. When the kube-apiserver briefly serves a cert without the kubernetes service ClusterIP (172.30.0.1) as an IP SAN during cert rotation, the error propagates immediately instead of being retried.This is a ~1% CI flake observed across upgrade jobs on both 5.0 and 5.1.
Changes
lib/resourceapply/apps.go: Added x509 and TLS certificate error checks toIsApplyErrorRetriable. Usesstrings.Containsmatching for"x509:"and"tls: failed to verify certificate", consistent with the existing"rpc error"check in the same function.lib/resourceapply/apps_test.go: Added 7 test cases covering rpc errors, x509 certificate errors, TLS verification failures, wrapped errors, and negative cases.Root Cause
applyManifests()inpkg/operator/sync.goalready retries withretry.DefaultRetry(5 retries, exponential backoff), but the predicateIsApplyErrorRetriableonly retries on:"rpc error"(string match)apierrors.IsConflictapierrors.IsTimeoutx509/TLS errors fall through and are not retried, causing the MCO to go Degraded for ~15 seconds until the next sync cycle succeeds after the kube-apiserver cert rotation completes.
Testing
go test ./lib/resourceapply/... -run TestIsApplyErrorRetriable— all 7 cases passretry.DefaultRetrybackoff (5 retries starting at ~200ms) comfortably covers the ~15-second cert rotation windowFixes: OCPBUGS-112464
AI-generated. Review for accuracy.
@sdodson requested in Slack thread
Summary by CodeRabbit