kubeconfig

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

View Source
const MinWaitTimeout = time.Second

MinWaitTimeout is the shortest --timeout accepted when --wait is set. Smaller values recreate issue #409: the deadline fires before a useful status is available, the CLI prints a near-empty partial report, and --cleanup then tears the run down immediately.

1s covers both commands. certification is event-driven (Watch). workloadrun checks status once immediately and then every 5s, so a 1s timeout still observes the WorkloadRun at least once.

Variables

This section is empty.

Functions

func ValidateWaitTimeout added in v0.6.0

func ValidateWaitTimeout(timeout time.Duration, wait bool) error

ValidateWaitTimeout rejects a --timeout below MinWaitTimeout when --wait is set. Without --wait, timeout is ignored (including 0 and negatives).

Types

type ConfigFlags

type ConfigFlags struct {
	KubeConfig *string
	Context    *string
	Namespace  *string
}

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL