move agent crd to kubesphere (#1974)

This commit is contained in:
zryfish
2020-03-29 16:49:11 +08:00
committed by GitHub
parent 96ddf4cfa0
commit 7121e3609c
30 changed files with 1278 additions and 32 deletions

View File

@@ -27,6 +27,7 @@ import (
networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
v1alpha2 "kubesphere.io/kubesphere/pkg/apis/servicemesh/v1alpha2"
tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1"
towerv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tower/v1alpha1"
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
@@ -81,6 +82,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case tenantv1alpha1.SchemeGroupVersion.WithResource("workspaces"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Tenant().V1alpha1().Workspaces().Informer()}, nil
// Group=tower.kubesphere.io, Version=v1alpha1
case towerv1alpha1.SchemeGroupVersion.WithResource("agents"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Tower().V1alpha1().Agents().Informer()}, nil
}
return nil, fmt.Errorf("no informer found for %v", resource)