Documentation ¶
Index ¶
- func GetConfigFromHostWithCertData(kubeconfigPath string, allowedContexts []string) (clientcmd.ClientConfig, error)
- func GetKubeconfigFromHost(kubeconfigPath string, contexts []string) ([]byte, error)
- func GetSelfAgentFromFileConfig(kubeconfigPath string) (*kubernetes.Agent, error)
- func ResolveKubeconfigPath(kubeconfigPath string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigFromHostWithCertData ¶
func GetConfigFromHostWithCertData(kubeconfigPath string, allowedContexts []string) (clientcmd.ClientConfig, error)
GetConfigFromHostWithCertData gets the kubeconfig using default options set on the host: the kubeconfig can either be retrieved from a specified path or an environment variable. This function only outputs a clientcmd that uses the allowedContexts.
This function also populates all of the certificate data that's specified as a filepath.
func GetKubeconfigFromHost ¶
GetKubeconfigFromHost returns the kubeconfig for a list of contexts using default options set on the host, or an explicit kubeconfig path. It then strips the kubeconfig of contexts not specified in the contexts array, and returns generate kubeconfig.
func GetSelfAgentFromFileConfig ¶ added in v0.5.0
func GetSelfAgentFromFileConfig(kubeconfigPath string) (*kubernetes.Agent, error)
GetSelfAgentFromFileConfig reads a kubeconfig from a local file and generates an Agent from that kubeconfig
func ResolveKubeconfigPath ¶
ResolveKubeconfigPath finds the path to a kubeconfig, first searching for the passed string, then in the home directory, then as an env variable.
Types ¶
This section is empty.