Documentation
¶
Overview ¶
Package kubeconfig provides a thin wrapper over k8s.io/client-go/tools/clientcmd for registering kubeconfig/context/namespace CLI flags, replacing the k8s.io/cli-runtime/pkg/genericclioptions.ConfigFlags dependency.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFlags ¶
ConfigFlags holds pointers to kubeconfig, context, and namespace flag values. A nil pointer field is skipped when AddFlags is called, making that flag unavailable in the command — matching the genericclioptions.ConfigFlags idiom.
func NewConfigFlags ¶
func NewConfigFlags(_ bool) *ConfigFlags
NewConfigFlags returns a ConfigFlags with all fields initialised to empty (non-nil) string pointers. The usePersistentConfig parameter is accepted for drop-in compatibility with genericclioptions.NewConfigFlags but is unused.
func (*ConfigFlags) AddFlags ¶
func (f *ConfigFlags) AddFlags(fs *pflag.FlagSet)
AddFlags registers whichever flags have non-nil pointer fields onto fs.
func (*ConfigFlags) ToRESTConfig ¶
func (f *ConfigFlags) ToRESTConfig() (*rest.Config, error)
ToRESTConfig returns a *rest.Config built from the configured kubeconfig and context.
func (*ConfigFlags) ToRawKubeConfigLoader ¶
func (f *ConfigFlags) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader returns a clientcmd.ClientConfig for low-level access (e.g., reading raw context/cluster information).