feat: support app.k8s.io applications paging query

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-10-17 17:04:48 +08:00
parent 90961a24df
commit e1a70bc8cd
5 changed files with 181 additions and 0 deletions

View File

@@ -291,6 +291,26 @@ func WaitForResourceSync(stopCh <-chan struct{}) error {
ksInformerFactory.Start(stopCh)
ksInformerFactory.WaitForCacheSync(stopCh)
appInformerFactory := informers.AppSharedInformerFactory()
appGVRs := []schema.GroupVersionResource{
{Group: "app.k8s.io", Version: "v1beta1", Resource: "applications"},
}
for _, gvr := range appGVRs {
if !isResourceExists(gvr) {
klog.Warningf("resource %s not exists in the cluster", gvr)
} else {
_, err := appInformerFactory.ForResource(gvr)
if err != nil {
return err
}
}
}
appInformerFactory.Start(stopCh)
appInformerFactory.WaitForCacheSync(stopCh)
klog.V(0).Info("Finished caching objects")
return nil