clientcmd

package
v3.9.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	// Specified by the caller
	DefaultScheme string
	DefaultPort   int
	AllowPrefix   bool

	// Provided will be true if Set is invoked
	Provided bool
	// Value is the exact value provided on the flag
	Value string

	// URL represents the user input. The Host field is guaranteed
	// to be set if Provided is true
	URL *url.URL
	// Host is the hostname or IP portion of the user input
	Host string
	// IPv6Host is true if the hostname appears to be an IPv6 input
	IPv6Host bool
	// Port is the port portion of the user input. Will be 0 if no port was found
	// and no default port could be established.
	Port int
}

Addr is a flag type that attempts to load a host, IP, host:port, or URL value from a string argument. It tracks whether the value was set and allows the caller to provide defaults for the scheme and port.

func (Addr) Default

func (a Addr) Default() Addr

Default creates a new Address with the value set

func (*Addr) Set

func (a *Addr) Set(value string) error

Set attempts to set a string value to an address

type Config

type Config struct {
	// MasterAddr is the address the master can be reached on (host, host:port, or URL).
	MasterAddr Addr
	// KubernetesAddr is the address of the Kubernetes server (host, host:port, or URL).
	// If omitted defaults to the master.
	KubernetesAddr Addr
	// CommonConfig is the shared base config for both the OpenShift config and Kubernetes config
	CommonConfig restclient.Config
	// Namespace is the namespace to act in
	Namespace string

	// If true, no environment is loaded (for testing, primarily)
	SkipEnv bool
	// contains filtered or unexported fields
}

Config contains all the necessary bits for client configuration

func NewConfig

func NewConfig() *Config

NewConfig returns a new configuration

func (*Config) BindToFile

func (cfg *Config) BindToFile(configPath string) *Config

func (*Config) KubeConfig

func (cfg *Config) KubeConfig() *restclient.Config

KubeConfig returns the Kubernetes configuration

Jump to

Keyboard shortcuts

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