1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-07 18:31:13 +00:00
Files
steve/pkg/resources/schema.go

42 lines
1.4 KiB
Go
Raw Normal View History

2019-08-13 16:36:03 -07:00
package resources
import (
2019-09-11 14:05:00 -07:00
"github.com/rancher/steve/pkg/accesscontrol"
"github.com/rancher/steve/pkg/clustercache"
"github.com/rancher/steve/pkg/resources/apigroups"
"github.com/rancher/steve/pkg/resources/common"
"github.com/rancher/steve/pkg/resources/core"
"github.com/rancher/steve/pkg/resources/counts"
"github.com/rancher/steve/pkg/resources/helmrelease"
"github.com/rancher/steve/pkg/resources/schema"
2019-08-14 13:39:08 -07:00
"github.com/rancher/norman/pkg/store/apiroot"
2019-08-13 16:36:03 -07:00
"github.com/rancher/norman/pkg/store/proxy"
"github.com/rancher/norman/pkg/subscribe"
"github.com/rancher/norman/pkg/types"
2019-09-09 14:28:55 -07:00
corev1controller "github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
2019-08-14 13:13:26 -07:00
"k8s.io/client-go/kubernetes"
2019-08-13 16:36:03 -07:00
)
2019-09-09 14:28:55 -07: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 16:36:03 -07:00
baseSchema := types.EmptySchemas()
collection := schema.NewCollection(baseSchema, as)
2019-09-09 14:28:55 -07:00
core.Register(collection)
counts.Register(baseSchema, ccache)
2019-08-13 16:36:03 -07:00
subscribe.Register(baseSchema)
2019-08-14 13:13:26 -07:00
apigroups.Register(baseSchema, k8s.Discovery())
2019-08-14 13:51:13 -07:00
apiroot.Register(baseSchema, []string{"v1"}, []string{"proxy:/apis"})
2019-09-09 14:28:55 -07:00
helmrelease.Register(baseSchema, configMaps, secrets)
2019-08-13 16:36:03 -07:00
common.Register(collection, getter)
return collection
}