config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2015 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdConfig

func NewCmdConfig(pathOptions *PathOptions, out io.Writer) *cobra.Command

func NewCmdConfigSet

func NewCmdConfigSet(out io.Writer, pathOptions *PathOptions) *cobra.Command

func NewCmdConfigSetAuthInfo

func NewCmdConfigSetAuthInfo(out io.Writer, pathOptions *PathOptions) *cobra.Command

func NewCmdConfigSetCluster

func NewCmdConfigSetCluster(out io.Writer, pathOptions *PathOptions) *cobra.Command

func NewCmdConfigSetContext

func NewCmdConfigSetContext(out io.Writer, pathOptions *PathOptions) *cobra.Command

func NewCmdConfigUnset

func NewCmdConfigUnset(out io.Writer, pathOptions *PathOptions) *cobra.Command

func NewCmdConfigUseContext

func NewCmdConfigUseContext(out io.Writer, pathOptions *PathOptions) *cobra.Command

func NewCmdConfigView

func NewCmdConfigView(out io.Writer, pathOptions *PathOptions) *cobra.Command

Types

type PathOptions added in v0.15.0

type PathOptions struct {
	Local     bool
	Global    bool
	UseEnvVar bool

	LocalFile  string
	GlobalFile string
	EnvVarFile string

	EnvVar           string
	ExplicitFileFlag string

	LoadingRules *clientcmd.ClientConfigLoadingRules
}

func NewDefaultPathOptions added in v0.15.0

func NewDefaultPathOptions() *PathOptions

func (*PathOptions) GetDefaultFilename added in v0.15.0

func (o *PathOptions) GetDefaultFilename() string

GetDefaultFilename returns the name of the file you should write into (create if necessary), if you're trying to create a new stanza as opposed to updating an existing one.

func (*PathOptions) GetExplicitFile added in v0.15.0

func (o *PathOptions) GetExplicitFile() string

func (*PathOptions) IsExplicitFile added in v0.15.0

func (o *PathOptions) IsExplicitFile() bool

func (*PathOptions) ModifyConfig added in v0.15.0

func (o *PathOptions) ModifyConfig(newConfig clientcmdapi.Config) error

ModifyConfig takes a Config object, iterates through Clusters, AuthInfos, and Contexts, uses the LocationOfOrigin if specified or uses the default destination file to write the results into. This results in multiple file reads, but it's very easy to follow. Preferences and CurrentContext should always be set in the default destination file. Since we can't distinguish between empty and missing values (no nil strings), we're forced have separate handling for them. In all the currently known cases, newConfig should have, at most, one difference, that means that this code will only write into a single file.

func (PathOptions) Validate added in v0.15.0

func (o PathOptions) Validate() error

Jump to

Keyboard shortcuts

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