Version: v0.35.0 Latest Latest

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 14 Imported by: 0




This section is empty.


This section is empty.


func GetKubeConfigStatus

func GetKubeConfigStatus(ip net.IP, filename string, machineName string) (bool, error)

GetKubeConfigStatus verifies the ip stored in kubeconfig.

func PopulateKubeConfig added in v0.22.0

func PopulateKubeConfig(cfg *KubeConfigSetup, kubecfg *api.Config) error

PopulateKubeConfig populates an api.Config object.

func ReadConfigOrNew

func ReadConfigOrNew(filename string) (*api.Config, error)

ReadConfigOrNew retrieves Kubernetes client configuration from a file. If no files exists, an empty configuration is returned.

func SetupKubeConfig

func SetupKubeConfig(cfg *KubeConfigSetup) error

SetupKubeConfig reads config from disk, adds the minikube settings, and writes it back. activeContext is true when minikube is the CurrentContext If no CurrentContext is set, the given name will be used.

func UpdateKubeconfigIP

func UpdateKubeconfigIP(ip net.IP, filename string, machineName string) (bool, error)

UpdateKubeconfigIP overwrites the IP stored in kubeconfig with the provided IP.

func WriteConfig

func WriteConfig(config *api.Config, filename string) error

WriteConfig encodes the configuration and writes it to the given file. If the file exists, it's contents will be overwritten.


type KubeConfigSetup

type KubeConfigSetup struct {
	// The name of the cluster for this context
	ClusterName string

	// ClusterServerAddress is the address of the kubernetes cluster
	ClusterServerAddress string

	// ClientCertificate is the path to a client cert file for TLS.
	ClientCertificate string

	// CertificateAuthority is the path to a cert file for the certificate authority.
	CertificateAuthority string

	// ClientKey is the path to a client key file for TLS.
	ClientKey string

	// Should the current context be kept when setting up this one
	KeepContext bool

	// Should the certificate files be embedded instead of referenced by path
	EmbedCerts bool
	// contains filtered or unexported fields

func (*KubeConfigSetup) GetKubeConfigFile

func (k *KubeConfigSetup) GetKubeConfigFile() string

func (*KubeConfigSetup) SetKubeConfigFile

func (k *KubeConfigSetup) SetKubeConfigFile(kubeConfigFile string)

Source Files

Jump to

Keyboard shortcuts

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