1
0
mirror of https://github.com/rancher/steve.git synced 2025-04-28 11:14:43 +00:00
steve/pkg/resources/schema.go

29 lines
910 B
Go
Raw Normal View History

2019-08-13 23:36:03 +00:00
package resources
import (
"github.com/rancher/naok/pkg/accesscontrol"
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-08-14 18:08:34 +00:00
"github.com/rancher/naok/pkg/resources/counts"
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-08-14 20:13:26 +00:00
"k8s.io/client-go/kubernetes"
2019-08-13 23:36:03 +00:00
)
2019-08-14 20:13:26 +00:00
func SchemaFactory(getter proxy.ClientGetter, as *accesscontrol.AccessStore, k8s kubernetes.Interface) *schema.Collection {
2019-08-13 23:36:03 +00:00
baseSchema := types.EmptySchemas()
collection := schema.NewCollection(baseSchema, as)
counts.Register(baseSchema)
subscribe.Register(baseSchema)
2019-08-14 20:13:26 +00:00
apigroups.Register(baseSchema, k8s.Discovery())
2019-08-14 20:39:08 +00:00
apiroot.Register(baseSchema, []string{"v1"}, nil)
2019-08-13 23:36:03 +00:00
common.Register(collection, getter)
return collection
}