config

package
v1.1.0-alpha.0....-c00828a Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Example (View)
expectedConfig := newRedFederalCowHammerConfig()
test := configCommandTest{
	args:           []string{"view"},
	startingConfig: newRedFederalCowHammerConfig(),
	expectedConfig: expectedConfig,
}

output := test.run(nil)
fmt.Printf("%v", output)
Output:

apiVersion: v1
clusters:
- cluster:
    server: http://cow.org:8080
  name: cow-cluster
contexts:
- context:
    cluster: cow-cluster
    user: red-user
  name: federal-context
current-context: federal-context
kind: Config
preferences: {}
users:
- name: red-user
  user:
    token: red-token

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdConfig

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

NewCmdConfig creates a command object for the "config" action, and adds all child commands to it.

func NewCmdConfigCurrentContext

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

func NewCmdConfigDeleteCluster

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

func NewCmdConfigDeleteContext

func NewCmdConfigDeleteContext(out, errOut io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command

func NewCmdConfigGetClusters

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

NewCmdConfigGetClusters creates a command object for the "get-clusters" action, which lists all clusters defined in the kubeconfig.

func NewCmdConfigGetContexts

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

NewCmdConfigGetContexts creates a command object for the "get-contexts" action, which retrieves one or more contexts from a kubeconfig.

func NewCmdConfigSet

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

func NewCmdConfigSetAuthInfo

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

func NewCmdConfigSetCluster

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

func NewCmdConfigSetContext

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

func NewCmdConfigUnset

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

func NewCmdConfigUseContext

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

func NewCmdConfigView

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

func RunCurrentContext

func RunCurrentContext(out io.Writer, options *CurrentContextOptions) error

Types

type CurrentContextOptions

type CurrentContextOptions struct {
	ConfigAccess clientcmd.ConfigAccess
}

type GetContextsOptions

type GetContextsOptions struct {
	// contains filtered or unexported fields
}

GetContextsOptions contains the assignable options from the args.

func (*GetContextsOptions) Complete

func (o *GetContextsOptions) Complete(cmd *cobra.Command, args []string, out io.Writer) error

Complete assigns GetContextsOptions from the args.

func (GetContextsOptions) RunGetContexts

func (o GetContextsOptions) RunGetContexts() error

RunGetContexts implements all the necessary functionality for context retrieval.

type ViewOptions

type ViewOptions struct {
	ConfigAccess clientcmd.ConfigAccess
	Merge        flag.Tristate
	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 printers.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