kubernetesk8s.io/kubernetes/pkg/kubectl/cmd/config Index | Files

package config

import "k8s.io/kubernetes/pkg/kubectl/cmd/config"

Index

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

type PathOptions struct {
	Local     bool
	Global    bool
	UseEnvVar bool

	LocalFile  string
	GlobalFile string
	EnvVarFile string

	EnvVar           string
	ExplicitFileFlag string

	LoadingRules *clientcmd.ClientConfigLoadingRules
}

func NewDefaultPathOptions

func NewDefaultPathOptions() *PathOptions

func (*PathOptions) GetDefaultFilename

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

func (o *PathOptions) GetExplicitFile() string

func (*PathOptions) IsExplicitFile

func (o *PathOptions) IsExplicitFile() bool

func (*PathOptions) ModifyConfig

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

func (o PathOptions) Validate() error

Source Files

config.go create_authinfo.go create_cluster.go create_context.go navigation_step_parser.go set.go unset.go use_context.go view.go

Version
v0.15.0
Published
Apr 13, 2015
Platform
windows/amd64
Imports
17 packages
Last checked
4 minutes ago

Tools for package owners.