Back to godoc.org

Package config

v0.6.1
Latest Go to latest

The latest major version is .

Published: Nov 22, 2019 | License: Apache-2.0 | Module: admiralty.io/multicluster-service-account

Index

func AllContextsForKubeconfig

func AllContextsForKubeconfig(kubeconfig string) ([]string, error)

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 ConfigAndNamespaceForKubeconfigAndContext

func ConfigAndNamespaceForKubeconfigAndContext(kubeconfig string, context string) (*rest.Config, string, error)

func LoaderForKubeconfigAndContext

func LoaderForKubeconfigAndContext(kubeconfig string, context string) clientcmd.ClientConfig

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)

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 (l *ServiceAccountImportConfigLoader) ConfigAccess() clientcmd.ConfigAccess

func (*ServiceAccountImportConfigLoader) ConfigAndNamespace

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

func (*ServiceAccountImportConfigLoader) Namespace

func (l *ServiceAccountImportConfigLoader) Namespace() (string, bool, error)

func (*ServiceAccountImportConfigLoader) RawConfig

func (l *ServiceAccountImportConfigLoader) RawConfig() (clientcmdapi.Config, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier