config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllNamedConfigsAndNamespaces

func AllNamedConfigsAndNamespaces() (map[string]ConfigAndNamespaceTuple, error)

AllNamedConfigsAndNamespaces returns a map of rest.Configs and namespaces corresponding to the mounted service account imports and kubeconfig contexts. If none is found, the map is empty.

func AllServiceAccountImportConfigLoaders

func AllServiceAccountImportConfigLoaders() (map[string]*ServiceAccountImportConfigLoader, error)

func AllServiceAccountImportConfigsAndNamespaces

func AllServiceAccountImportConfigsAndNamespaces() (map[string]ConfigAndNamespaceTuple, error)

AllServiceAccountImportConfigsAndNamespaces returns a map of rest.Configs and namespaces corresponding to the mounted service account imports. If none is found, the map is empty.

func AllServiceAccountImportNames

func AllServiceAccountImportNames() ([]string, error)

func ConfigAndNamespace

func ConfigAndNamespace() (*rest.Config, string, error)

ConfigAndNamespace returns a rest.Config and namespace from a mounted service account import. If several service account imports are mounted, an error is returned. It no service account import is mounted, ConfigAndNamespace falls back to the current kubeconfig context or the regular service account.

func ConfigAndNamespaceForContext

func ConfigAndNamespaceForContext(context string) (*rest.Config, string, error)

ConfigAndNamespaceForContext returns a rest.Config and namespace from a kubeconfig context whose name is given as an argument. It it doesn't exist, an error is returned.

func NamedConfigAndNamespace

func NamedConfigAndNamespace(name string) (*rest.Config, string, error)

NamedConfigAndNamespace returns a rest.Config and namespace from a mounted service account import whose name is given as an argument. It no mounted service account import matches that name, NamedConfigAndNamespace attempts to fall back to an eponymous kubeconfig context. Otherwise, an error is returned.

func NamedServiceAccountImportConfigAndNamespace

func NamedServiceAccountImportConfigAndNamespace(name string) (*rest.Config, string, error)

NamedServiceAccountImportConfigAndNamespace returns a rest.Config and namespace from a mounted service account import whose name is given as an argument. It no mounted service account import matches that name, an error is returned.

func ServiceAccountImportConfigAndNamespace

func ServiceAccountImportConfigAndNamespace() (*rest.Config, string, error)

ServiceAccountImportConfigAndNamespace returns a rest.Config and namespace from a mounted service account import. If none or several service account imports are mounted, an error is returned.

func ServiceAccountImportMounted

func ServiceAccountImportMounted(name string) (bool, error)

func SingleServiceAccountImportName

func SingleServiceAccountImportName() (string, error)

Types

type ConfigAndNamespaceTuple

type ConfigAndNamespaceTuple struct {
	Config    *rest.Config
	Namespace string
}

ConfigAndNamespaceTuple combines a rest.Config pointer and Namespace. It is used as a map value in functions of this package returning multiple configurations (the "All...()" functions).

type ServiceAccountImportConfigLoader

type ServiceAccountImportConfigLoader struct {
	Name string
	// contains filtered or unexported fields
}

ServiceAccountImportConfigLoader partially implements client-go/tools/clientcmd.ClientConfig, to integrate with that package's general-purpose config loading logic.

func NewNamedServiceAccountImportConfigLoader

func NewNamedServiceAccountImportConfigLoader(name string) (*ServiceAccountImportConfigLoader, error)

func NewServiceAccountImportConfigLoader

func NewServiceAccountImportConfigLoader() (*ServiceAccountImportConfigLoader, error)

func (*ServiceAccountImportConfigLoader) ClientConfig

func (l *ServiceAccountImportConfigLoader) ClientConfig() (*rest.Config, error)

func (*ServiceAccountImportConfigLoader) ConfigAccess

func (*ServiceAccountImportConfigLoader) ConfigAndNamespace

func (l *ServiceAccountImportConfigLoader) ConfigAndNamespace() (*rest.Config, string, error)

func (*ServiceAccountImportConfigLoader) Namespace

func (*ServiceAccountImportConfigLoader) RawConfig

Jump to

Keyboard shortcuts

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