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 ¶
- func NewCmdConfig(f cmdutil.Factory, pathOptions *clientcmd.PathOptions, ...) *cobra.Command
- func NewCmdConfigCurrentContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigDeleteCluster(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigDeleteContext(out, errOut io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigGetClusters(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigGetContexts(streams genericclioptions.IOStreams, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigRenameContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigSet(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigSetAuthInfo(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigSetCluster(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigSetContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigUnset(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigUseContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command
- func NewCmdConfigView(f cmdutil.Factory, streams genericclioptions.IOStreams, ...) *cobra.Command
- func RunCurrentContext(out io.Writer, options *CurrentContextOptions) error
- type CurrentContextOptions
- type GetContextsOptions
- type RenameContextOptions
- type ViewOptions
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdConfig ¶
func NewCmdConfig(f cmdutil.Factory, pathOptions *clientcmd.PathOptions, streams genericclioptions.IOStreams) *cobra.Command
NewCmdConfig creates a command object for the "config" action, and adds all child commands to it.
func NewCmdConfigGetClusters ¶
NewCmdConfigGetClusters creates a command object for the "get-clusters" action, which lists all clusters defined in the kubeconfig.
func NewCmdConfigGetContexts ¶
func NewCmdConfigGetContexts(streams genericclioptions.IOStreams, 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 NewCmdConfigRenameContext ¶
NewCmdConfigRenameContext creates a command object for the "rename-context" action
func NewCmdConfigSet ¶
func NewCmdConfigSetAuthInfo ¶
func NewCmdConfigSetCluster ¶
func NewCmdConfigSetContext ¶
func NewCmdConfigUnset ¶
func NewCmdConfigUseContext ¶
func NewCmdConfigView ¶
func NewCmdConfigView(f cmdutil.Factory, streams genericclioptions.IOStreams, 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 { genericclioptions.IOStreams // 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) 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 RenameContextOptions ¶
type RenameContextOptions struct {
// contains filtered or unexported fields
}
RenameContextOptions contains the options for running the rename-context cli command.
func (RenameContextOptions) RunRenameContext ¶
func (o RenameContextOptions) RunRenameContext(out io.Writer) error
func (RenameContextOptions) Validate ¶
func (o RenameContextOptions) Validate() error
type ViewOptions ¶
type ViewOptions struct { PrintFlags *kubectlConfigPrintFlags PrintObject printers.ResourcePrinterFunc ConfigAccess clientcmd.ConfigAccess Merge flag.Tristate Flatten bool Minify bool RawByteData bool Context string OutputFormat string genericclioptions.IOStreams }
func (ViewOptions) Run ¶
func (o ViewOptions) Run() error
func (ViewOptions) Validate ¶
func (o ViewOptions) Validate() error