mirror of
https://github.com/rancher/steve.git
synced 2025-08-12 03:31:35 +00:00
29 lines
930 B
Go
29 lines
930 B
Go
package resources
|
|
|
|
import (
|
|
"github.com/rancher/naok/pkg/accesscontrol"
|
|
"github.com/rancher/naok/pkg/resources/apigroups"
|
|
"github.com/rancher/naok/pkg/resources/common"
|
|
"github.com/rancher/naok/pkg/resources/counts"
|
|
"github.com/rancher/naok/pkg/resources/schema"
|
|
"github.com/rancher/norman/pkg/store/apiroot"
|
|
"github.com/rancher/norman/pkg/store/proxy"
|
|
"github.com/rancher/norman/pkg/subscribe"
|
|
"github.com/rancher/norman/pkg/types"
|
|
"k8s.io/client-go/kubernetes"
|
|
)
|
|
|
|
func SchemaFactory(getter proxy.ClientGetter, as *accesscontrol.AccessStore, k8s kubernetes.Interface) *schema.Collection {
|
|
baseSchema := types.EmptySchemas()
|
|
collection := schema.NewCollection(baseSchema, as)
|
|
|
|
counts.Register(baseSchema)
|
|
subscribe.Register(baseSchema)
|
|
apigroups.Register(baseSchema, k8s.Discovery())
|
|
apiroot.Register(baseSchema, []string{"v1"}, []string{"proxy:/apis"})
|
|
|
|
common.Register(collection, getter)
|
|
|
|
return collection
|
|
}
|