Documentation ¶
Index ¶
- func ConfigToString(conf *k8s.Config) (string, error)
- func CopyFile(src, target string) error
- func FileExists(name string) bool
- func GetClusterByName(config *k8s.Config, clusterName *string) (*k8s.NamedCluster, error)
- func GetContextByName(config *k8s.Config, contextName *string) (*k8s.NamedContext, error)
- func GetDefaultKubeconfig() (*k8s.Config, error)
- func GetDefaultKubeconfigPath() (path string, err error)
- func GetUserByName(config *k8s.Config, userName *string) (*k8s.NamedAuthInfo, error)
- func IsRegularFile(path string) bool
- func ReadKubeConfigYaml(filePath string) (*k8s.Config, error)
- func WriteKubeConfigYaml(target string, conf *k8s.Config)
- type ContextNameProvider
- type RandomNameProvider
- type SeedNameProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists reports whether the named file or directory exists.
func GetClusterByName ¶
GetClusterByName returns the cluster with the given name or an error
func GetContextByName ¶
GetContextByName returns the first context with the given name
func GetDefaultKubeconfig ¶
GetDefaultKubeconfig returns the default user kubeconfig (e.g. ~/.kube/config)
func GetDefaultKubeconfigPath ¶
GetDefaultKubeconfigPath returns the path to the default user kubeconfig (e.g. ~/.kube/config)
func GetUserByName ¶
GetUserByName returns the user with the given name or an error
func IsRegularFile ¶
IsRegularFile checks whether the path is a regular file or not.
func ReadKubeConfigYaml ¶
ReadKubeConfigYaml deserializes a kubeconfig yaml file into a KubeConfig object.
func WriteKubeConfigYaml ¶
WriteKubeConfigYaml writes a KubeConfig into a file
Types ¶
type ContextNameProvider ¶
type ContextNameProvider interface {
GetName() string
}
ContextNameProvider provides a name for a context.
type RandomNameProvider ¶
type RandomNameProvider struct{}
RandomNameProvider creates a random name with the following pattern: <adjective>-<noun> (e.g. adorable-pizza)
func (*RandomNameProvider) GetName ¶
func (*RandomNameProvider) GetName() string
GetName method for RandomNameProvider. Creates a random name with the following pattern: <adjective>-<noun> (e.g. adorable-pizza).
type SeedNameProvider ¶
type SeedNameProvider struct { //Seed - first name that will returned by GetName Seed string // contains filtered or unexported fields }
SeedNameProvider will return the seed on first "GetName". Afterwards a suffix will be attached.
func (*SeedNameProvider) GetName ¶
func (p *SeedNameProvider) GetName() string
GetName will return the seed on first call. Afterwards a suffix will be attached.