Documentation ¶
Index ¶
- Constants
- Variables
- type ConfigLoader
- type Environment
- type KubeconfigPath
- func (instance KubeconfigPath) IsEmpty() bool
- func (instance KubeconfigPath) IsInCluster() bool
- func (instance KubeconfigPath) IsMock() bool
- func (instance *KubeconfigPath) Set(plain string) error
- func (instance KubeconfigPath) String() string
- func (instance KubeconfigPath) ToConfigLoader(targetContext string) ConfigLoader
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
Click to show internal directories.
Click to hide internal directories.