client

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitClient

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

func (c *Config) BindClientGoFlags(cmd *cobra.Command)

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

func (c *Config) GetAPISpec(server string) string

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) Namespace

func (c *Config) Namespace() (string, error)

Namespace returns the namespace for the provided ClientConfig.

func (*Config) ResolveContext

func (c *Config) ResolveContext(context string) (server, namespace string, err error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL