Documentation
¶
Index ¶
- func IsFilePathLoadableByKubectl(path string, verbose bool) (isLoadable bool, err error)
- func ListContextNamesUsingKubectl(path string, verbose bool) (contextNames []string, err error)
- type KubeConfig
- func (k *KubeConfig) AddClusterAndContextAndUserEntry(cluster *KubeConfigCluster, kubeConfigContext *KubeConfigContext, ...) (err error)
- func (k *KubeConfig) AddClusterEntry(cluster *KubeConfigCluster) (err error)
- func (k *KubeConfig) AddConfig(toAdd *KubeConfig) (err error)
- func (k *KubeConfig) AddContextEntry(kubeConfigContext *KubeConfigContext) (err error)
- func (k *KubeConfig) AddUserEntry(user *KubeConfigUser) (err error)
- func (k *KubeConfig) GetAsYamlString() (yamlSring string, err error)
- func (k *KubeConfig) GetClientKeyDataForUser(name string) (string, error)
- func (k *KubeConfig) GetClusterAndContextAndUserEntryByName(name string) (cluster *KubeConfigCluster, kubeConfigContext *KubeConfigContext, ...)
- func (k *KubeConfig) GetClusterEntryByName(name string) (cluster *KubeConfigCluster, err error)
- func (k *KubeConfig) GetClusterNames() (clusterNames []string, err error)
- func (k *KubeConfig) GetClusterServerUrlAsString(clusterName string) (string, error)
- func (k *KubeConfig) GetContextEntryByName(name string) (kubeConfigContext *KubeConfigContext, err error)
- func (k *KubeConfig) GetDeepCopy() (copy *KubeConfig)
- func (k *KubeConfig) GetServerNames() (serverNames []string, err error)
- func (k *KubeConfig) GetUserEntryByName(name string) (kubeConfigContext *KubeConfigUser, err error)
- func (k *KubeConfig) GetUserNameByContextName(contextName string) (userName string, err error)
- func (k *KubeConfig) WriteToFile(outFile files.File, verbose bool) (err error)
- func (k *KubeConfig) WriteToFileByPath(path string, verbose bool) (err error)
- func (k *KubeConfig) WriteToTemporaryFileAndGetPath(verbose bool) (tempFilePath string, err error)
- type KubeConfigCluster
- type KubeConfigClusterCluster
- type KubeConfigContext
- type KubeConfigUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFilePathLoadableByKubectl ¶
This function does an exex to "kubectl" using the given config file "path". Useful to validate if a written config "path" is understood by "kubectl".
Types ¶
type KubeConfig ¶
type KubeConfig struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Clusters []KubeConfigCluster `yaml:"clusters"` Contexts []KubeConfigContext `yaml:"contexts"` Users []KubeConfigUser `yaml:"users"` }
func LoadFromFile ¶
func LoadFromFile(file files.File, verbose bool) (config *KubeConfig, err error)
func LoadFromFilePath ¶
func LoadFromFilePath(path string, verbose bool) (config *KubeConfig, err error)
func MergeConfig ¶
func MergeConfig(configs ...*KubeConfig) (merged *KubeConfig, err error)
func (*KubeConfig) AddClusterAndContextAndUserEntry ¶
func (k *KubeConfig) AddClusterAndContextAndUserEntry(cluster *KubeConfigCluster, kubeConfigContext *KubeConfigContext, user *KubeConfigUser) (err error)
func (*KubeConfig) AddClusterEntry ¶
func (k *KubeConfig) AddClusterEntry(cluster *KubeConfigCluster) (err error)
func (*KubeConfig) AddConfig ¶
func (k *KubeConfig) AddConfig(toAdd *KubeConfig) (err error)
func (*KubeConfig) AddContextEntry ¶
func (k *KubeConfig) AddContextEntry(kubeConfigContext *KubeConfigContext) (err error)
func (*KubeConfig) AddUserEntry ¶
func (k *KubeConfig) AddUserEntry(user *KubeConfigUser) (err error)
func (*KubeConfig) GetAsYamlString ¶
func (k *KubeConfig) GetAsYamlString() (yamlSring string, err error)
func (*KubeConfig) GetClientKeyDataForUser ¶ added in v0.328.0
func (k *KubeConfig) GetClientKeyDataForUser(name string) (string, error)
func (*KubeConfig) GetClusterAndContextAndUserEntryByName ¶
func (k *KubeConfig) GetClusterAndContextAndUserEntryByName(name string) (cluster *KubeConfigCluster, kubeConfigContext *KubeConfigContext, user *KubeConfigUser, err error)
func (*KubeConfig) GetClusterEntryByName ¶
func (k *KubeConfig) GetClusterEntryByName(name string) (cluster *KubeConfigCluster, err error)
func (*KubeConfig) GetClusterNames ¶
func (k *KubeConfig) GetClusterNames() (clusterNames []string, err error)
func (*KubeConfig) GetClusterServerUrlAsString ¶ added in v0.328.0
func (k *KubeConfig) GetClusterServerUrlAsString(clusterName string) (string, error)
func (*KubeConfig) GetContextEntryByName ¶
func (k *KubeConfig) GetContextEntryByName(name string) (kubeConfigContext *KubeConfigContext, err error)
func (*KubeConfig) GetDeepCopy ¶
func (k *KubeConfig) GetDeepCopy() (copy *KubeConfig)
func (*KubeConfig) GetServerNames ¶
func (k *KubeConfig) GetServerNames() (serverNames []string, err error)
func (*KubeConfig) GetUserEntryByName ¶
func (k *KubeConfig) GetUserEntryByName(name string) (kubeConfigContext *KubeConfigUser, err error)
func (*KubeConfig) GetUserNameByContextName ¶
func (k *KubeConfig) GetUserNameByContextName(contextName string) (userName string, err error)
func (*KubeConfig) WriteToFile ¶
func (k *KubeConfig) WriteToFile(outFile files.File, verbose bool) (err error)
func (*KubeConfig) WriteToFileByPath ¶
func (k *KubeConfig) WriteToFileByPath(path string, verbose bool) (err error)
func (*KubeConfig) WriteToTemporaryFileAndGetPath ¶
func (k *KubeConfig) WriteToTemporaryFileAndGetPath(verbose bool) (tempFilePath string, err error)
type KubeConfigCluster ¶
type KubeConfigCluster struct { Name string `yaml:"name"` Cluster KubeConfigClusterCluster `yaml:"cluster"` }
func (*KubeConfigCluster) GetServerUrlAsString ¶ added in v0.328.0
func (k *KubeConfigCluster) GetServerUrlAsString() (string, error)
type KubeConfigContext ¶
type KubeConfigContext struct { Name string `yaml:"name"` Context struct { Cluster string `yaml:"cluster"` Namespace string `yaml:"namespace"` User string `yaml:"user"` } `yaml:"context"` }
func (KubeConfigContext) GetUserName ¶
func (k KubeConfigContext) GetUserName() (userName string, err error)
type KubeConfigUser ¶
type KubeConfigUser struct { Name string `yaml:"name"` User struct { ClientCertificateData string `yaml:"client-certificate-data"` ClientKeyData string `yaml:"client-key-data"` Username string `yaml:"username"` Password string `yaml:"password"` } `yaml:"user"` }
func (*KubeConfigUser) GetClientKeyData ¶ added in v0.328.0
func (k *KubeConfigUser) GetClientKeyData() (string, error)
Click to show internal directories.
Click to hide internal directories.