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

@@ -185,7 +185,7 @@ func (s *APIServer) buildHandlerChain() {
handler := s.Server.Handler
handler = filters.WithKubeAPIServer(handler, s.KubernetesClient.Config(), &errorResponder{})
handler = filters.WithMultipleClusterDispatcher(handler, dispatch.DefaultClusterDispatch)
handler = filters.WithMultipleClusterDispatcher(handler, dispatch.NewClusterDispatch(s.InformerFactory.KubeSphereSharedInformerFactory().Tower().V1alpha1().Agents().Lister()))
excludedPaths := []string{"/oauth/authorize", "/oauth/token"}
pathAuthorizer, _ := path.NewAuthorizer(excludedPaths)
@@ -275,6 +275,7 @@ func (s *APIServer) waitForResourceSync(stopCh <-chan struct{}) error {
ksGVRs := []schema.GroupVersionResource{
{Group: "tenant.kubesphere.io", Version: "v1alpha1", Resource: "workspaces"},
{Group: "tower.kubesphere.io", Version: "v1alpha1", Resource: "agents"},
}
devopsGVRs := []schema.GroupVersionResource{