Documentation ¶
Index ¶
- func InitClient(env string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
- type Config
- func (c *Config) BindClientGoFlags(cmd *cobra.Command)
- func (c *Config) GetAPISpec(server string) string
- func (c *Config) Namespace() (string, error)
- func (c *Config) ResolveContext(context string) (server, namespace string, err error)
- func (c *Config) RestClient(envName *string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitClient ¶
func InitClient(env string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
InitClient initializes a new ClientConfig given the specified environment spec and returns the ClientPool, DiscoveryInterface, and namespace.
Types ¶
type Config ¶
type Config struct { Overrides *clientcmd.ConfigOverrides LoadingRules *clientcmd.ClientConfigLoadingRules Config clientcmd.ClientConfig }
Config is a wrapper around client-go's ClientConfig
func NewClientConfig ¶
func NewClientConfig(overrides clientcmd.ConfigOverrides, loadingRules clientcmd.ClientConfigLoadingRules) *Config
NewClientConfig initializes a new client.Config with the provided loading rules and overrides.
func NewDefaultClientConfig ¶
func NewDefaultClientConfig() *Config
NewDefaultClientConfig initializes a new ClientConfig with default loading rules and no overrides.
func (*Config) BindClientGoFlags ¶
BindClientGoFlags binds client-go flags to the specified command. This way any overrides to client-go flags will automatically update the client config.
func (*Config) GetAPISpec ¶
GetAPISpec reads the kubernetes API version from this client's swagger.json. We anticipate the swagger.json to be located at <server>/swagger.json. If no swagger is found, or we are unable to authenticate to the server, we will default to version:v1.7.0.
func (*Config) ResolveContext ¶
ResolveContext returns the server and namespace of the cluster at the provided context. If the context string is empty, the "default" context is used.
func (*Config) RestClient ¶
func (c *Config) RestClient(envName *string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
RestClient returns the ClientPool, DiscoveryInterface, and Namespace based on the environment spec.