Files
kustomize/kyaml/openapi/builtin_schema.go
koba1t 9216c6f573 chore: refactor read scheme to openapi from kubernetes api definition
Previously, only a single embedded Kubernetes API version could be specified, resulting in a lack of support for certain GVKs.
To address this, the goal is to create and utilize a unified scheme that consolidates Kubernetes API definitions.
As a preliminary step, the current method of loading API definitions will be improved.
2026-08-02 22:39:33 +09:00

28 lines
938 B
Go

// Copyright 2026 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package openapi
import _ "embed"
//go:generate go run ./cmd/openapi-bundle -input kubernetesapi/v1_21_2/swagger.pb.gz -output kubernetesapi/data/kubernetes-openapi-union-v1.21.2.bundle-v1.json.gz -kubernetes-version v1.21.2
const (
// DefaultOpenAPI is the Kubernetes version represented by the built-in
// schema. It remains v1.21.2 during the initial artifact-format migration.
DefaultOpenAPI = "v1.21.2"
// BuiltinSchemaInfo is the value printed by `kustomize openapi info`.
BuiltinSchemaInfo = "{title:Kubernetes,version:" + DefaultOpenAPI + "}"
)
//go:embed kubernetesapi/data/kubernetes-openapi-union-v1.21.2.bundle-v1.json.gz
var builtinKubernetesOpenAPIBundle []byte
//go:embed kustomizationapi/swagger.json
var builtinKustomizationOpenAPI []byte
func hasBuiltinOpenAPIVersion(version string) bool {
return version == DefaultOpenAPI
}