2019-08-13 16:36:03 -07:00
|
|
|
package resources
|
|
|
|
|
|
|
|
import (
|
2020-02-10 10:18:20 -07:00
|
|
|
"github.com/rancher/steve/pkg/accesscontrol"
|
2020-01-30 22:01:21 -07:00
|
|
|
"github.com/rancher/steve/pkg/client"
|
2019-09-11 14:05:00 -07:00
|
|
|
"github.com/rancher/steve/pkg/clustercache"
|
2020-01-30 22:37:59 -07:00
|
|
|
"github.com/rancher/steve/pkg/schema"
|
|
|
|
"github.com/rancher/steve/pkg/schemaserver/store/apiroot"
|
2020-03-01 09:00:08 -07:00
|
|
|
"github.com/rancher/steve/pkg/schemaserver/subscribe"
|
2020-01-30 22:37:59 -07:00
|
|
|
"github.com/rancher/steve/pkg/schemaserver/types"
|
|
|
|
"github.com/rancher/steve/pkg/server/resources/apigroups"
|
|
|
|
"github.com/rancher/steve/pkg/server/resources/common"
|
|
|
|
"github.com/rancher/steve/pkg/server/resources/counts"
|
2020-03-12 13:14:47 -07:00
|
|
|
"github.com/rancher/steve/pkg/server/resources/userpreferences"
|
|
|
|
"github.com/rancher/steve/pkg/server/store/proxy"
|
2020-01-30 22:37:59 -07:00
|
|
|
"k8s.io/client-go/discovery"
|
2019-08-13 16:36:03 -07:00
|
|
|
)
|
|
|
|
|
2020-03-12 13:14:47 -07:00
|
|
|
func DefaultSchemas(baseSchema *types.APISchemas, ccache clustercache.ClusterCache, cg proxy.ClientGetter) *types.APISchemas {
|
2019-09-09 14:28:55 -07:00
|
|
|
counts.Register(baseSchema, ccache)
|
2020-03-01 09:00:08 -07:00
|
|
|
subscribe.Register(baseSchema)
|
2019-08-14 13:51:13 -07:00
|
|
|
apiroot.Register(baseSchema, []string{"v1"}, []string{"proxy:/apis"})
|
2020-03-12 13:14:47 -07:00
|
|
|
userpreferences.Register(baseSchema, cg)
|
2020-01-30 22:37:59 -07:00
|
|
|
return baseSchema
|
|
|
|
}
|
2019-08-13 16:36:03 -07:00
|
|
|
|
2020-03-10 23:12:04 -07:00
|
|
|
func DefaultSchemaTemplates(cf *client.Factory, lookup accesscontrol.AccessSetLookup, discovery discovery.DiscoveryInterface) []schema.Template {
|
2020-01-30 22:37:59 -07:00
|
|
|
return []schema.Template{
|
2020-02-10 10:18:20 -07:00
|
|
|
common.DefaultTemplate(cf, lookup),
|
2020-03-10 23:12:04 -07:00
|
|
|
apigroups.Template(discovery),
|
2020-01-30 22:01:21 -07:00
|
|
|
}
|
2019-08-13 16:36:03 -07:00
|
|
|
}
|