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

29 lines
999 B
Go
Raw Normal View History

2019-08-13 23:36:03 +00:00
package resources
import (
2020-01-31 05:01:21 +00:00
"github.com/rancher/steve/pkg/client"
2019-09-11 21:05:00 +00:00
"github.com/rancher/steve/pkg/clustercache"
2020-01-31 05:37:59 +00:00
"github.com/rancher/steve/pkg/schema"
"github.com/rancher/steve/pkg/schemaserver/store/apiroot"
"github.com/rancher/steve/pkg/schemaserver/subscribe"
"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"
"k8s.io/client-go/discovery"
2019-08-13 23:36:03 +00:00
)
2020-01-31 05:37:59 +00:00
func DefaultSchemas(baseSchema *types.APISchemas, discovery discovery.DiscoveryInterface, ccache clustercache.ClusterCache) *types.APISchemas {
2019-09-09 21:28:55 +00:00
counts.Register(baseSchema, ccache)
2019-08-13 23:36:03 +00:00
subscribe.Register(baseSchema)
2020-01-31 05:37:59 +00:00
apigroups.Register(baseSchema, discovery)
2019-08-14 20:51:13 +00:00
apiroot.Register(baseSchema, []string{"v1"}, []string{"proxy:/apis"})
2020-01-31 05:37:59 +00:00
return baseSchema
}
2019-08-13 23:36:03 +00:00
2020-01-31 05:37:59 +00:00
func DefaultSchemaTemplates(cf *client.Factory) []schema.Template {
return []schema.Template{
common.DefaultTemplate(cf),
2020-01-31 05:01:21 +00:00
}
2019-08-13 23:36:03 +00:00
}