config

package
v0.0.0-...-e56ae8b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModifyConfig

func ModifyConfig(configAccess ConfigAccess, newConfig clientcmdapi.Config, relativizePaths bool) 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 the kubeconfig cases, newConfig should have at most one difference, that means that this code will only write into a single file. If you want to relativizePaths, you must provide a fully qualified path in any modified element.

func NewCmdConfig

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

func NewCmdConfigSet

func NewCmdConfigSet(out io.Writer, configAccess ConfigAccess) *cobra.Command

func NewCmdConfigSetAuthInfo

func NewCmdConfigSetAuthInfo(out io.Writer, configAccess ConfigAccess) *cobra.Command

func NewCmdConfigSetCluster

func NewCmdConfigSetCluster(out io.Writer, configAccess ConfigAccess) *cobra.Command

func NewCmdConfigSetContext

func NewCmdConfigSetContext(out io.Writer, configAccess ConfigAccess) *cobra.Command

func NewCmdConfigUnset

func NewCmdConfigUnset(out io.Writer, configAccess ConfigAccess) *cobra.Command

func NewCmdConfigUseContext

func NewCmdConfigUseContext(out io.Writer, configAccess ConfigAccess) *cobra.Command

func NewCmdConfigView

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

Types

type ConfigAccess

type ConfigAccess interface {
	// GetLoadingPrecedence returns the slice of files that should be used for loading and inspecting the config
	GetLoadingPrecedence() []string
	// GetStartingConfig returns the config that subcommands should being operating against.  It may or may not be merged depending on loading rules
	GetStartingConfig() (*clientcmdapi.Config, error)
	// 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.
	GetDefaultFilename() string
	// IsExplicitFile indicates whether or not this command is interested in exactly one file.  This implementation only ever does that  via a flag, but implementations that handle local, global, and flags may have more
	IsExplicitFile() bool
	// GetExplicitFile returns the particular file this command is operating against.  This implementation only ever has one, but implementations that handle local, global, and flags may have more
	GetExplicitFile() string
}

ConfigAccess is used by subcommands and methods in this package to load and modify the appropriate config files

type PathOptions

type PathOptions struct {
	// GlobalFile is the full path to the file to load as the global (final) option
	GlobalFile string
	// EnvVar is the env var name that points to the list of kubeconfig files to load
	EnvVar string
	// ExplicitFileFlag is the name of the flag to use for prompting for the kubeconfig file
	ExplicitFileFlag string

	// GlobalFileSubpath is an optional value used for displaying help
	GlobalFileSubpath string

	LoadingRules *clientcmd.ClientConfigLoadingRules
}

func NewDefaultPathOptions

func NewDefaultPathOptions() *PathOptions

func (*PathOptions) GetDefaultFilename

func (o *PathOptions) GetDefaultFilename() string

func (*PathOptions) GetEnvVarFiles

func (o *PathOptions) GetEnvVarFiles() []string

func (*PathOptions) GetExplicitFile

func (o *PathOptions) GetExplicitFile() string

func (*PathOptions) GetLoadingPrecedence

func (o *PathOptions) GetLoadingPrecedence() []string

func (*PathOptions) GetStartingConfig

func (o *PathOptions) GetStartingConfig() (*clientcmdapi.Config, error)

func (*PathOptions) IsExplicitFile

func (o *PathOptions) IsExplicitFile() bool

type ViewOptions

type ViewOptions struct {
	ConfigAccess ConfigAccess
	Merge        util.BoolFlag
	Flatten      bool
	Minify       bool
	RawByteData  bool
}

func (*ViewOptions) Complete

func (o *ViewOptions) Complete() bool

func (ViewOptions) Run

func (o ViewOptions) Run(out io.Writer, printer kubectl.ResourcePrinter) error

func (ViewOptions) Validate

func (o ViewOptions) Validate() error

Jump to

Keyboard shortcuts

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