1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-02 07:55:31 +00:00

Adding schema definitions endpoint

Introduces new schema definitions endpoint, allowing the caller to get
the fields/types/descriptions for a given kubernetes resource.
This commit is contained in:
Michael Bolot
2023-11-27 16:10:05 -06:00
parent 3f65942a6a
commit 40f6b10fc7
10 changed files with 378 additions and 13 deletions

View File

@@ -16,7 +16,6 @@ import (
"github.com/rancher/steve/pkg/resources/formatters"
"github.com/rancher/steve/pkg/resources/userpreferences"
"github.com/rancher/steve/pkg/schema"
steveschema "github.com/rancher/steve/pkg/schema"
"github.com/rancher/steve/pkg/stores/proxy"
"github.com/rancher/steve/pkg/summarycache"
corecontrollers "github.com/rancher/wrangler/v2/pkg/generated/controllers/core/v1"
@@ -25,7 +24,7 @@ import (
)
func DefaultSchemas(ctx context.Context, baseSchema *types.APISchemas, ccache clustercache.ClusterCache,
cg proxy.ClientGetter, schemaFactory steveschema.Factory, serverVersion string) error {
cg proxy.ClientGetter, schemaFactory schema.Factory, serverVersion string) error {
counts.Register(baseSchema, ccache)
subscribe.Register(baseSchema, func(apiOp *types.APIRequest) *types.APISchemas {
user, ok := request.UserFrom(apiOp.Context())