fix: wire readiness manager into ApisixPluginConfig and ApisixUpstream controllers#2729
Open
aslitaser wants to merge 1 commit intoapache:masterfrom
Open
fix: wire readiness manager into ApisixPluginConfig and ApisixUpstream controllers#2729aslitaser wants to merge 1 commit intoapache:masterfrom
aslitaser wants to merge 1 commit intoapache:masterfrom
Conversation
…m controllers (apache#2725) ApisixPluginConfig and ApisixUpstream controllers were missing the Readier field and never called Done() on the readiness manager. This caused the provider to always wait the full 5-minute hardcoded timeout before starting the sync loop on every restart.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes startup readiness gating for API v2 ApisixPluginConfig and ApisixUpstream by wiring them into the shared readiness manager so the provider sync loop doesn’t wait the full hardcoded 5-minute timeout on restarts (Fixes #2725).
Changes:
- Inject
ReadierintoApisixPluginConfigReconcilerandApisixUpstreamReconcilerduring controller setup. - Add
Readierfields to both reconcilers. - Call
defer r.Readier.Done(...)at the start of bothReconcile()methods to mark pending resources as processed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/manager/controllers.go | Passes the readiness manager into the ApisixPluginConfig and ApisixUpstream controllers during setup. |
| internal/controller/apisixupstream_controller.go | Adds readiness manager dependency + marks ApisixUpstream reconciliations as done for readiness tracking. |
| internal/controller/apisixpluginconfig_controller.go | Adds readiness manager dependency + marks ApisixPluginConfig reconciliations as done for readiness tracking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Hi @aslitaser, please add a test case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change:
What this PR does / why we need it:
Fixes #2725
ApisixPluginConfigandApisixUpstreamcontrollers were missing theReadierfield and never calledDone()on the readiness manager. This caused the provider to always wait the full 5-minute hardcoded timeout before starting the sync loop on every restart.Root cause: When
registerAPIv2ForReadiness()registers these CRD types with the readiness manager, it adds all existing resources to a pending state. TheApisixRouteReconcilercorrectly callsdefer r.Readier.Done()in itsReconcile()to mark resources as done, butApisixPluginConfigReconcilerandApisixUpstreamReconcilerwere never wired up with the readiness manager — missing both the struct field and theDone()call.Fix:
Readier readiness.ReadinessManagerfield to both controller structsdefer r.Readier.Done()at the start of bothReconcile()methodsReadier: readierwhen initializing both controllers incontrollers.goPre-submission checklist: