fix: use v1alpha2 APIBindings informer in DynamicRESTMapper HasSynced check#3870
Conversation
|
Hi @maxpain. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
… check The DynamicTypesController is instantiated with a v1alpha2 APIBindings informer, but the HasSynced wait function checks v1alpha1 APIBindings informer sync status. Since the SharedInformerFactory creates separate informers per API version (keyed by reflect.Type), the v1alpha1 informer is never started by factory.Start() (which only starts previously registered informers). An unstarted informer has a nil controller, causing HasSynced() to return false indefinitely, which prevents the DynamicRESTMapper controller from ever starting. Signed-off-by: Max Makarov <maxpain@linux.com>
fcd6c35 to
25e5532
Compare
|
/ok-to-test |
|
/kind bug |
|
/retest |
|
LGTM label has been added. DetailsGit tree hash: a0c5264a1572838953b588644dccc21f79b11b11 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis 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 |
|
/ok-to-test |
|
/release-note |
|
@gman0: the 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. |
|
/release-note Fixed informer sync wait |
|
@maxpain please update your release notes in the PR description -- it may be left empty. Like so: |
Done |
|
/retest |
Problem
The
DynamicTypesControlleris instantiated with a v1alpha2APIBindingsinformer:But the
HasSyncedwait function checks the v1alpha1 informer:Since the
SharedInformerFactorycreates separate informers per API version (keyed byreflect.Type), andfactory.Start()only starts previously registered informers, the sequence is:V1alpha2().APIBindings()→ registers v1alpha2 informer in factoryfactory.Start()starts all registered informers (only v1alpha2)HasSyncedcallsV1alpha1().APIBindings().Informer()→ lazily creates a new v1alpha1 informer, but it is never startedcontroller == nil, soHasSynced()returnsfalseindefinitelyPollUntilContextCancelFix
Change the
HasSyncedcheck to useV1alpha2().APIBindings(), matching the informer version passed to the controller constructor.Impact
Without this fix, the DynamicRESTMapper controller never starts, which prevents dynamic API discovery from working correctly for resources introduced via APIBindings.