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

package config

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

Example (View)

Code:

{
	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
}

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

Functions

func NewCmdConfig

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

func NewCmdConfigCurrentContext

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

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 io.Writer, ConfigAccess clientcmd.ConfigAccess) *cobra.Command

func RunCurrentContext

func RunCurrentContext(out io.Writer, args []string, options *CurrentContextOptions) error

Types

type CurrentContextOptions

type CurrentContextOptions struct {
	ConfigAccess clientcmd.ConfigAccess
}

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 kubectl.ResourcePrinter) error

func (ViewOptions) Validate

func (o ViewOptions) Validate() error

Source Files

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

Version
v1.3.0-alpha.4
Published
May 17, 2016
Platform
js/wasm
Imports
19 packages
Last checked
28 seconds ago

Tools for package owners.