mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-03 10:37:21 +09:00
Since k8s.io/apiserver v0.35 the DefinitionNamer returns the generated openapi map key verbatim instead of running it through ToRESTFriendlyName. The core.cozystack.io and sdn.cozystack.io types were keyed in the generated openapi map by their Go import path, so slash-containing definition names reached the published /openapi/v2. kube-openapi's v2 model builder escapes the slashes in $ref as "~1" and resolves refs by literal string match without unescaping, so any cross-type reference (Option -> OptionSpec, SecurityGroup -> SecurityGroupSpec, ...) becomes an unresolvable model and the entire merged document is rejected by every v2 consumer: Helm manifest validation while installing backupstrategy-controller (which blocks the in-tree E2E install), Argo CD's cluster cache, and kubectl explain --output=plaintext-openapiv2. Add OpenAPIModelName methods for every core and sdn type, mirroring pkg/apis/apps/v1alpha1/model_name.go, and regenerate the openapi so the map keys and $ref targets use the slash-free dotted form. This also restores the x-kubernetes-group-version-kind extension on those kinds, whose GVK map is keyed by the friendly name. Fixes #3582 Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Andrey Kolkov <androndo@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>