multicluster-service-account: admiralty.io/multicluster-service-account/pkg/config Index | Files

package config

import "admiralty.io/multicluster-service-account/pkg/config"

Index

Package Files

config.go

func AllContextsForKubeconfig Uses

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

func AllNamedConfigsAndNamespaces Uses

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 Uses

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

func AllServiceAccountImportConfigsAndNamespaces Uses

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 Uses

func AllServiceAccountImportNames() ([]string, error)

func ConfigAndNamespace Uses

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 Uses

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 Uses

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

func LoaderForKubeconfigAndContext Uses

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

func NamedConfigAndNamespace Uses

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 Uses

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 Uses

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 Uses

func ServiceAccountImportMounted(name string) (bool, error)

func SingleServiceAccountImportName Uses

func SingleServiceAccountImportName() (string, error)

type ConfigAndNamespaceTuple Uses

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 Uses

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 Uses

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

func NewServiceAccountImportConfigLoader Uses

func NewServiceAccountImportConfigLoader() (*ServiceAccountImportConfigLoader, error)

func (*ServiceAccountImportConfigLoader) ClientConfig Uses

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

func (*ServiceAccountImportConfigLoader) ConfigAccess Uses

func (l *ServiceAccountImportConfigLoader) ConfigAccess() clientcmd.ConfigAccess

func (*ServiceAccountImportConfigLoader) ConfigAndNamespace Uses

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

func (*ServiceAccountImportConfigLoader) Namespace Uses

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

func (*ServiceAccountImportConfigLoader) RawConfig Uses

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

Package config imports 5 packages (graph) and is imported by 11 packages. Updated 2019-11-25. Refresh now. Tools for package owners.