config

package
v0.0.0-...-f34f428 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnMarshalHelper

func UnMarshalHelper(values map[string]interface{}, intf interface{}) error

Types

type KubeConfigCluster

type KubeConfigCluster struct {
	Name    string `yaml:"name"`
	Cluster struct {
		Server string
	}
}

type KubeConfigClusterDetail

type KubeConfigClusterDetail struct {
	Server string `yaml:"server"`
}

type KubeConfigContexts

type KubeConfigContexts struct {
	Name    string `yaml:"name"`
	Context struct {
		Cluster string
		User    string
	} `yaml:"context"`
}

type KubeConfigFile

type KubeConfigFile struct {
	ApiVersion     string               `yaml:"apiVersion"`
	Kind           string               `yaml:"kind"`
	Clusters       []KubeConfigCluster  `yaml:"clusters"`
	Users          []KubeConfigUser     `yaml:"users"`
	Contexts       []KubeConfigContexts `yaml:"contexts"`
	CurrentContext string               `yaml:"current-context"`
}

func ParseKubeConfig

func ParseKubeConfig(kubeConfigData []byte) (*KubeConfigFile, error)

func (*KubeConfigFile) GetClusterByAPIEndpoint

func (k *KubeConfigFile) GetClusterByAPIEndpoint(endpoint string) (*KubeConfigCluster, error)

func (*KubeConfigFile) GetClusterByName

func (k *KubeConfigFile) GetClusterByName(name string) (*KubeConfigCluster, error)

func (*KubeConfigFile) GetClusterContext

func (k *KubeConfigFile) GetClusterContext(clusterName string) (*KubeConfigContexts, error)

func (*KubeConfigFile) GetContext

func (k *KubeConfigFile) GetContext(contextName string) (*KubeConfigContexts, error)

func (*KubeConfigFile) GetUser

func (k *KubeConfigFile) GetUser(userName string) (*KubeConfigUser, error)

func (*KubeConfigFile) GetUserForCluster

func (k *KubeConfigFile) GetUserForCluster(clusterEndpoint string) (*KubeConfigUser, error)

type KubeConfigUser

type KubeConfigUser struct {
	Name string `yaml:"name"`
	User struct {
		AuthProvider struct {
			Name   string                 `yaml:"name"`
			Config map[string]interface{} `yaml:"config"`
		} `yaml:"auth-provider,omitempty"`
		ClientCertificate string `yaml:"client-certificate-data,omitempty"`
		ClientKeyData     string `yaml:"client-key-data,omitempty"`
		Token             string `yaml:"token,omitempty"`
	}
}

Jump to

Keyboard shortcuts

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