client

package
v0.0.0-...-87b999f Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2018 License: Apache-2.0 Imports: 21 Imported by: 3

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 ApplyOptions

type ApplyOptions struct {
	Create bool
	GcTag  string
	SkipGc bool
	DryRun bool
	Client *Config
}

ApplyOptions are options for applying objects to a cluster.

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.

type DeleteOptions

type DeleteOptions struct {
	GracePeriod int64
	Client      *Config
}

DeleteOptions are options for deleting from a cluster.

Jump to

Keyboard shortcuts

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