merge main

This commit is contained in:
Ryan McKinley
2025-07-02 13:33:33 -07:00
parent c1c1f3a85c
commit fb0aaa321e
18 changed files with 449 additions and 361 deletions
+22 -1
View File
@@ -119,8 +119,29 @@ func getOpenAPIPostProcessor(version string, builders []APIGroupBuilder) func(*s
// Remove the growing list of kinds
for k, v := range copy.Components.Schemas {
if strings.HasPrefix(k, "io.k8s.apimachinery.pkg.apis.meta.v1") && v.Extensions != nil {
if v.Extensions == nil {
continue
}
if strings.HasPrefix(k, "io.k8s.apimachinery.pkg.apis.meta.v1") {
delete(v.Extensions, "x-kubernetes-group-version-kind") // a growing list of everything
continue
}
// Remove the internal annotations
val, ok := v.Extensions["x-kubernetes-group-version-kind"]
if ok {
gvks, ok := val.([]any)
if ok {
keep := make([]map[string]any, 0, len(gvks))
for _, val := range gvks {
gvk, ok := val.(map[string]any)
if ok && gvk["version"] == "__internal" {
continue
}
keep = append(keep, gvk)
}
v.Extensions["x-kubernetes-group-version-kind"] = keep
}
}
}