1
0
mirror of https://github.com/rancher/steve.git synced 2025-06-03 04:10:24 +00:00
steve/pkg/resources/schema.go

42 lines
1.3 KiB
Go
Raw Normal View History

2019-08-13 23:36:03 +00:00
package resources
import (
"github.com/rancher/naok/pkg/accesscontrol"
2019-09-09 21:28:55 +00:00
"github.com/rancher/naok/pkg/clustercache"
2019-08-14 20:13:26 +00:00
"github.com/rancher/naok/pkg/resources/apigroups"
2019-08-13 23:36:03 +00:00
"github.com/rancher/naok/pkg/resources/common"
2019-09-09 21:28:55 +00:00
"github.com/rancher/naok/pkg/resources/core"
2019-08-14 18:08:34 +00:00
"github.com/rancher/naok/pkg/resources/counts"
2019-09-09 21:28:55 +00:00
"github.com/rancher/naok/pkg/resources/helmrelease"
2019-08-13 23:36:03 +00:00
"github.com/rancher/naok/pkg/resources/schema"
2019-08-14 20:39:08 +00:00
"github.com/rancher/norman/pkg/store/apiroot"
2019-08-13 23:36:03 +00:00
"github.com/rancher/norman/pkg/store/proxy"
"github.com/rancher/norman/pkg/subscribe"
"github.com/rancher/norman/pkg/types"
2019-09-09 21:28:55 +00:00
corev1controller "github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
2019-08-14 20:13:26 +00:00
"k8s.io/client-go/kubernetes"
2019-08-13 23:36:03 +00:00
)
2019-09-09 21:28:55 +00:00
func SchemaFactory(getter proxy.ClientGetter,
as *accesscontrol.AccessStore,
k8s kubernetes.Interface,
ccache clustercache.ClusterCache,
configMaps corev1controller.ConfigMapClient,
secrets corev1controller.SecretClient,
) *schema.Collection {
2019-08-13 23:36:03 +00:00
baseSchema := types.EmptySchemas()
collection := schema.NewCollection(baseSchema, as)
2019-09-09 21:28:55 +00:00
core.Register(collection)
counts.Register(baseSchema, ccache)
2019-08-13 23:36:03 +00:00
subscribe.Register(baseSchema)
2019-08-14 20:13:26 +00:00
apigroups.Register(baseSchema, k8s.Discovery())
2019-08-14 20:51:13 +00:00
apiroot.Register(baseSchema, []string{"v1"}, []string{"proxy:/apis"})
2019-09-09 21:28:55 +00:00
helmrelease.Register(baseSchema, configMaps, secrets)
2019-08-13 23:36:03 +00:00
common.Register(collection, getter)
return collection
}