Documentation ¶
Index ¶
- func AllNamedConfigsAndNamespaces() (map[string]ConfigAndNamespaceTuple, error)
- func AllServiceAccountImportConfigLoaders() (map[string]*ServiceAccountImportConfigLoader, error)
- func AllServiceAccountImportConfigsAndNamespaces() (map[string]ConfigAndNamespaceTuple, error)
- func AllServiceAccountImportNames() ([]string, error)
- func ConfigAndNamespace() (*rest.Config, string, error)
- func ConfigAndNamespaceForContext(context string) (*rest.Config, string, error)
- func NamedConfigAndNamespace(name string) (*rest.Config, string, error)
- func NamedServiceAccountImportConfigAndNamespace(name string) (*rest.Config, string, error)
- func ServiceAccountImportConfigAndNamespace() (*rest.Config, string, error)
- func ServiceAccountImportMounted(name string) (bool, error)
- func SingleServiceAccountImportName() (string, error)
- type ConfigAndNamespaceTuple
- type ServiceAccountImportConfigLoader
- func (l *ServiceAccountImportConfigLoader) ClientConfig() (*rest.Config, error)
- func (l *ServiceAccountImportConfigLoader) ConfigAccess() clientcmd.ConfigAccess
- func (l *ServiceAccountImportConfigLoader) ConfigAndNamespace() (*rest.Config, string, error)
- func (l *ServiceAccountImportConfigLoader) Namespace() (string, bool, error)
- func (l *ServiceAccountImportConfigLoader) RawConfig() (clientcmdapi.Config, error)
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 ConfigAndNamespace ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.
Types ¶
type ConfigAndNamespaceTuple ¶
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)