Provisioning: discontinue use of service identity based background tasks when onlyApiServer is true (#112634)

* Skip informers if Provisioning disable controllers is enabled

* Hydrate requester correctly for Grafana Live

* revert to old code because eventualRestConfig provider issues

---------

Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
This commit is contained in:
Roberto Jiménez Sánchez
2025-10-23 00:35:46 +00:00
committed by GitHub
co-authored by Charandas Batra
parent fbc81d2fd0
commit c9daec7b6d
3 changed files with 15 additions and 9 deletions
+4 -5
View File
@@ -648,11 +648,6 @@ func (b *APIBuilder) GetPostStartHooks() (map[string]genericapiserver.PostStartH
return err
}
// Informer with resync interval used for health check and reconciliation
sharedInformerFactory := informers.NewSharedInformerFactory(c, 60*time.Second)
repoInformer := sharedInformerFactory.Provisioning().V0alpha1().Repositories()
jobInformer := sharedInformerFactory.Provisioning().V0alpha1().Jobs()
b.client = c.ProvisioningV0alpha1()
// Initialize the API client-based job store
@@ -669,6 +664,10 @@ func (b *APIBuilder) GetPostStartHooks() (map[string]genericapiserver.PostStartH
return nil
}
// Informer with resync interval used for health check and reconciliation
sharedInformerFactory := informers.NewSharedInformerFactory(c, 60*time.Second)
repoInformer := sharedInformerFactory.Provisioning().V0alpha1().Repositories()
jobInformer := sharedInformerFactory.Provisioning().V0alpha1().Jobs()
go repoInformer.Informer().Run(postStartHookCtx.Done())
go jobInformer.Informer().Run(postStartHookCtx.Done())