Documentation ¶
Index ¶
- func InitClient(a app.App, env string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
- type Config
- func (c *Config) BindClientGoFlags(cmd *cobra.Command)
- func (c *Config) GetAPISpec() string
- func (c *Config) Namespace() (string, error)
- func (c *Config) ResolveContext(context string) (server, namespace string, err error)
- func (c *Config) RestClient(a app.App, envName *string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitClient ¶
func InitClient(a app.App, 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. TODO DELETEME?
Types ¶
type Config ¶
type Config struct { Overrides *clientcmd.ConfigOverrides LoadingRules *clientcmd.ClientConfigLoadingRules Config clientcmd.ClientConfig // contains filtered or unexported fields }
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 Open API schema. If there is an error retrieving the schema, return the default version.
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(a app.App, envName *string) (dynamic.ClientPool, discovery.DiscoveryInterface, string, error)
RestClient returns the ClientPool, DiscoveryInterface, and Namespace based on the environment spec.