kubernetes

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceTokenFile  = "/var/run/secrets/kubernetes.io/serviceaccount/token"
	ServiceRootCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
	ServiceNamespace  = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
)
View Source
const (
	KubeconfigInCluster = "incluster"
	KubeconfigMock      = "mock"
	EnvVarKubeconfig    = "KUBE_CONFIG"
)

Variables

View Source
var (
	ErrNoFile = errors.New("no file")
)

Functions

This section is empty.

Types

type ConfigLoader

type ConfigLoader struct {
	clientcmd.ClientConfigLoader
	Kubeconfig        string
	DefaultKubeconfig string
	TargetContext     string
}

func (ConfigLoader) IsDefaultConfig

func (instance ConfigLoader) IsDefaultConfig(*restclient.Config) bool

func (ConfigLoader) Load

func (instance ConfigLoader) Load() (*clientcmdapi.Config, error)

type Environment

type Environment struct {
	Kubeconfig KubeconfigPath
	Context    string
	Namespace  string
	// contains filtered or unexported fields
}

func MustNewEnvironment

func MustNewEnvironment() *Environment

func NewEnvironment

func NewEnvironment() (env *Environment, err error)

func (*Environment) ContextName

func (instance *Environment) ContextName() (string, error)

func (*Environment) NewClient

func (instance *Environment) NewClient() (kubernetes.Interface, error)

func (*Environment) NewDynamicClient

func (instance *Environment) NewDynamicClient() (dynamic.Interface, error)

func (*Environment) RegisterFlag

func (instance *Environment) RegisterFlag(fe support.FlagEnabled, appPrefix string) error

type KubeconfigPath

type KubeconfigPath struct {
	ResolveDefaultLocation func() string
	// contains filtered or unexported fields
}

func (KubeconfigPath) IsEmpty

func (instance KubeconfigPath) IsEmpty() bool

func (KubeconfigPath) IsInCluster

func (instance KubeconfigPath) IsInCluster() bool

func (KubeconfigPath) IsMock

func (instance KubeconfigPath) IsMock() bool

func (*KubeconfigPath) Set

func (instance *KubeconfigPath) Set(plain string) error

func (KubeconfigPath) String

func (instance KubeconfigPath) String() string

func (KubeconfigPath) ToConfigLoader

func (instance KubeconfigPath) ToConfigLoader(targetContext string) ConfigLoader

Jump to

Keyboard shortcuts

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