Skip to content

fix: wire readiness manager into ApisixPluginConfig and ApisixUpstream controllers#2729

Open
aslitaser wants to merge 1 commit intoapache:masterfrom
aslitaser:fix/readiness-manager-2725
Open

fix: wire readiness manager into ApisixPluginConfig and ApisixUpstream controllers#2729
aslitaser wants to merge 1 commit intoapache:masterfrom
aslitaser:fix/readiness-manager-2725

Conversation

@aslitaser
Copy link
Copy Markdown

Type of change:

  • Bugfix

What this PR does / why we need it:

Fixes #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.

Root cause: When registerAPIv2ForReadiness() registers these CRD types with the readiness manager, it adds all existing resources to a pending state. The ApisixRouteReconciler correctly calls defer r.Readier.Done() in its Reconcile() to mark resources as done, but ApisixPluginConfigReconciler and ApisixUpstreamReconciler were never wired up with the readiness manager — missing both the struct field and the Done() call.

Fix:

  • Add Readier readiness.ReadinessManager field to both controller structs
  • Add defer r.Readier.Done() at the start of both Reconcile() methods
  • Pass Readier: readier when initializing both controllers in controllers.go

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

…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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Readier into ApisixPluginConfigReconciler and ApisixUpstreamReconciler during controller setup.
  • Add Readier fields to both reconcilers.
  • Call defer r.Readier.Done(...) at the start of both Reconcile() 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.

@Baoyuantop
Copy link
Copy Markdown
Contributor

Hi @aslitaser, please add a test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: readiness manager

3 participants