client

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 13 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. 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

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() string

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) 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(a app.App, 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