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"
|
|
|
|
"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-13 23:36:03 +00:00
|
|
|
|
|
|
|
common.Register(collection, getter)
|
|
|
|
|
|
|
|
return collection
|
|
|
|
}
|