1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-16 07:18:28 +00:00

Adding APIGroups back to the schema

Prior schema calculations started with openapiv2 models which included a
model for APIGroups. However, new schema calculations use
ServerGroupsAndResources first, which omitted these values. This
re-adds this type using a static schema.
This commit is contained in:
Michael Bolot
2024-07-02 13:27:04 -05:00
parent 9ac9be9c0e
commit e7a76d14f0
3 changed files with 84 additions and 27 deletions

View File

@@ -7,10 +7,22 @@ import (
"github.com/rancher/apiserver/pkg/store/empty"
"github.com/rancher/apiserver/pkg/types"
wschemas "github.com/rancher/wrangler/v3/pkg/schemas"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/discovery"
)
var BaseSchema = types.APISchema{
Schema: &wschemas.Schema{
ID: "apigroup",
Attributes: map[string]interface{}{
"group": "",
"kind": "APIGroup",
"version": "v1",
},
},
}
func Template(discovery discovery.DiscoveryInterface) schema.Template {
return schema.Template{
ID: "apigroup",