Files
kustomize/kustomize/commands/openapi/info/info.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

26 lines
549 B
Go

// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package info
import (
"fmt"
"io"
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/kyaml/openapi"
)
// NewCmdInfo makes a new info command.
func NewCmdInfo(w io.Writer) *cobra.Command {
infoCmd := cobra.Command{
Use: "info",
Short: "Prints the `info` field from the kubernetes OpenAPI data",
Example: `kustomize openapi info`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Fprintln(w, openapi.BuiltinSchemaInfo)
},
}
return &infoCmd
}