File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -462,10 +462,6 @@ func (o *CommandPromoteOption) promoteDeps(memberClusterFactory cmdutil.Factory,
462
462
serviceLister := sharedFactory .Core ().V1 ().Services ().Lister ()
463
463
sharedFactory .Start (ctx .Done ())
464
464
sharedFactory .WaitForCacheSync (ctx .Done ())
465
- controlPlaneInformerManager .Start ()
466
- if sync := controlPlaneInformerManager .WaitForCacheSync (); sync == nil {
467
- return errors .New ("informer factory for cluster does not exist" )
468
- }
469
465
470
466
defaultInterpreter := native .NewDefaultInterpreter ()
471
467
thirdpartyInterpreter := thirdparty .NewConfigurableInterpreter ()
@@ -475,6 +471,11 @@ func (o *CommandPromoteOption) promoteDeps(memberClusterFactory cmdutil.Factory,
475
471
return fmt .Errorf ("failed to create customized interpreter: %v" , err )
476
472
}
477
473
474
+ controlPlaneInformerManager .Start ()
475
+ if syncs := controlPlaneInformerManager .WaitForCacheSync (); len (syncs ) == 0 {
476
+ return errors .New ("no informers registered in the informer factory" )
477
+ }
478
+
478
479
// check if the resource interpreter supports to interpret dependencies
479
480
if ! defaultInterpreter .HookEnabled (obj .GroupVersionKind (), configv1alpha1 .InterpreterOperationInterpretDependency ) &&
480
481
! thirdpartyInterpreter .HookEnabled (obj .GroupVersionKind (), configv1alpha1 .InterpreterOperationInterpretDependency ) &&
You can’t perform that action at this time.
0 commit comments