kubeconfig

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig() (*clientgo.Config, error)

GetConfig returns the currently loaded configuration via LoadConfig(). Returns an error if LoadConfig() has not been called.

func GetPathOptions

func GetPathOptions() *kubectl.PathOptions

GetPathOptions contains options for the kubectl config file

func LoadConfig

func LoadConfig(kubeconfigFile string) error

LoadConfig loads a kubeconfig from the specified kubeconfigFile, or uses the recommended file from kubectl defaults ($HOME/.kube/config). If the file exists it will use the existing configuration as a base for the changes, otherwise it starts a new configuration. Returns an error only if the existing file is not a valid configuration or it can't be read.

func Remove

func Remove(name string) error

Remove deletes all items related to the specified target: cluster, context, user. Returns an error if LoadConfig() has not been called.f

func UpdateConfig

func UpdateConfig(name string, aliases []string, tokenData *client.TargetInfo) error

UpdateConfig loads the current kubeconfig file and applies the changes described in the tokenData. Once applied, it writes the changes to disk. It will use the specified name for the names of the cluster, user and context. It will create an additional context for each of the aliases provided

Types

This section is empty.

Jump to

Keyboard shortcuts

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