1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-05 17:30:39 +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

@@ -18,6 +18,7 @@ import (
"github.com/rancher/steve/pkg/resources/common"
"github.com/rancher/steve/pkg/resources/schemas"
"github.com/rancher/steve/pkg/schema"
"github.com/rancher/steve/pkg/schema/definitions"
"github.com/rancher/steve/pkg/server/handler"
"github.com/rancher/steve/pkg/server/router"
"github.com/rancher/steve/pkg/summarycache"
@@ -141,6 +142,7 @@ func setup(ctx context.Context, server *Server) error {
if err = resources.DefaultSchemas(ctx, server.BaseSchemas, ccache, server.ClientFactory, sf, server.Version); err != nil {
return err
}
definitions.Register(server.BaseSchemas, server.controllers.K8s.Discovery())
summaryCache := summarycache.New(sf, ccache)
summaryCache.Start(ctx)