kubernetes: github.com/erimatnor/kubernetes/pkg/kubectl/cmd/config Index | Files

package config

import "github.com/erimatnor/kubernetes/pkg/kubectl/cmd/config"


Package 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

func ModifyConfig Uses

func ModifyConfig(configAccess ConfigAccess, 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 the kubeconfig cases, newConfig should have at most one difference, that means that this code will only write into a single file.

func NewCmdConfig Uses

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

func NewCmdConfigSet Uses

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

func NewCmdConfigSetAuthInfo Uses

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

func NewCmdConfigSetCluster Uses

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

func NewCmdConfigSetContext Uses

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

func NewCmdConfigUnset Uses

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

func NewCmdConfigUseContext Uses

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

func NewCmdConfigView Uses

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

type ConfigAccess Uses

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 Uses

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 Uses

func NewDefaultPathOptions() *PathOptions

func (*PathOptions) GetDefaultFilename Uses

func (o *PathOptions) GetDefaultFilename() string

func (*PathOptions) GetEnvVarFiles Uses

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

func (*PathOptions) GetExplicitFile Uses

func (o *PathOptions) GetExplicitFile() string

func (*PathOptions) GetLoadingPrecedence Uses

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

func (*PathOptions) GetStartingConfig Uses

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

func (*PathOptions) IsExplicitFile Uses

func (o *PathOptions) IsExplicitFile() bool

type ViewOptions Uses

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

func (*ViewOptions) Complete Uses

func (o *ViewOptions) Complete() bool

func (ViewOptions) Run Uses

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

func (ViewOptions) Validate Uses

func (o ViewOptions) Validate() error

Package config imports 18 packages (graph). Updated 2017-05-11. Refresh now. Tools for package owners.