Documentation ¶
Index ¶
- type KubeConfig
- func (k *KubeConfig) GetContext() (string, error)
- func (k *KubeConfig) HandleErrors() error
- func (k *KubeConfig) IsExpired(context string) (bool, error)
- func (k *KubeConfig) MergeYaml(yaml []byte) *KubeConfig
- func (k *KubeConfig) SetContext(context string) *KubeConfig
- func (k *KubeConfig) SetNamespace(namespace string) *KubeConfig
- func (k *KubeConfig) Write() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubeConfig ¶
type KubeConfig struct { Config *clientcmdapi.Config Path string Errors []error }
KubeConfig is the kubeconfig file
func LoadFromDefaultFile ¶
func LoadFromDefaultFile() (*KubeConfig, error)
NewKubeConfig loads the kubeconfig file
func LoadFromFile ¶
func LoadFromFile(path string) (*KubeConfig, error)
LoadFromFile loads the kubeconfig file
func LoadOrNewKubeConfig ¶
func LoadOrNewKubeConfig() *KubeConfig
LoadOrNewKubeConfig loads the kubeconfig file or creates a new one
func MustLoadFromDefaultFile ¶
func MustLoadFromDefaultFile() *KubeConfig
LoadKubeConfig loads the kubeconfig file
func MustLoadFromFile ¶
func MustLoadFromFile(path string) *KubeConfig
LoadFromFile loads the kubeconfig file
func (*KubeConfig) GetContext ¶
func (k *KubeConfig) GetContext() (string, error)
GetCurrentContext gets the current context
func (*KubeConfig) HandleErrors ¶
func (k *KubeConfig) HandleErrors() error
Handle errors return a string of errors
func (*KubeConfig) IsExpired ¶
func (k *KubeConfig) IsExpired(context string) (bool, error)
IsExpired check if the selected contexts token is expired
func (*KubeConfig) MergeYaml ¶
func (k *KubeConfig) MergeYaml(yaml []byte) *KubeConfig
LoadFromBytes loads the kubeconfig file
func (*KubeConfig) SetContext ¶
func (k *KubeConfig) SetContext(context string) *KubeConfig
SetCurrentContext sets the current context
func (*KubeConfig) SetNamespace ¶ added in v0.2.4
func (k *KubeConfig) SetNamespace(namespace string) *KubeConfig
SetNamespace sets the namespace for the current context
Click to show internal directories.
Click to hide internal directories.