config

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClusterAdminName = "kubernetes-admin"
View Source
var DefaultClusterName = "kubernetes"
View Source
var DefaultContextName = fmt.Sprintf("%s@%s", DefaultClusterAdminName, DefaultClusterName)

DefaultPath defines the default path

Functions

func GetConfigAccess

func GetConfigAccess(explicitPath string) clientcmd.ConfigAccess

func GetRemoteKubeconfig

func GetRemoteKubeconfig(ctx context.Context, sp *specs.Specs, sshKeyPath string, verbose, skipTLSVerify bool) (string, error)

GetRemoteKubeconfig retrieves Kubernetes configuration from a master node of the cluster

func Merge

func Merge(existing *clientcmdapi.Config, tomerge *clientcmdapi.Config) *clientcmdapi.Config

Merge two kubeconfig objects

func RenameConfig

func RenameConfig(sp *specs.Specs, newConfig *clientcmdapi.Config)

RenameConfig renames the default cluster and context names to the values from cluster.yaml

func Sanitize

func Sanitize(configStr string, params Params) (string, error)

Sanitize sanitizes, and possibly transforms the provided Kubernetes configuration.

func Write

func Write(path string, newConfig clientcmdapi.Config, setContext bool) (string, error)

Write will write Kubernetes client configuration to a file. If path isn't specified then the path will be determined by client-go. If file pointed to by path doesn't exist it will be created. If the file already exists then the configuration will be merged with the existing file.

Types

type Params

type Params struct {
	APIServerExternalEndpoint string
	SkipTLSVerify             bool
}

Params groups the various settings to transform Kubernetes configurations.

Jump to

Keyboard shortcuts

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