Files
Andrey KolkovandClaude Opus 4.8 10446d26d8 fix(api): dot core/sdn OpenAPI model names so aggregated v2 spec parses
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>
2026-08-13 11:11:22 +04:00
..