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

27 lines
812 B
Go
Raw Normal View History

2019-08-13 16:36:03 -07:00
package resources
import (
"github.com/rancher/naok/pkg/accesscontrol"
2019-08-14 13:13:26 -07:00
"github.com/rancher/naok/pkg/resources/apigroups"
2019-08-13 16:36:03 -07:00
"github.com/rancher/naok/pkg/resources/common"
2019-08-14 11:08:34 -07:00
"github.com/rancher/naok/pkg/resources/counts"
2019-08-13 16:36:03 -07:00
"github.com/rancher/naok/pkg/resources/schema"
"github.com/rancher/norman/pkg/store/proxy"
"github.com/rancher/norman/pkg/subscribe"
"github.com/rancher/norman/pkg/types"
2019-08-14 13:13:26 -07:00
"k8s.io/client-go/kubernetes"
2019-08-13 16:36:03 -07:00
)
2019-08-14 13:13:26 -07:00
func SchemaFactory(getter proxy.ClientGetter, as *accesscontrol.AccessStore, k8s kubernetes.Interface) *schema.Collection {
2019-08-13 16:36:03 -07:00
baseSchema := types.EmptySchemas()
collection := schema.NewCollection(baseSchema, as)
counts.Register(baseSchema)
subscribe.Register(baseSchema)
2019-08-14 13:13:26 -07:00
apigroups.Register(baseSchema, k8s.Discovery())
2019-08-13 16:36:03 -07:00
common.Register(collection, getter)
return collection
}