cmd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(a []string, x string) bool

Contains util, whether str x is in the slice a

func NewCmdCleanup

func NewCmdCleanup(streams genericclioptions.IOStreams) *cobra.Command

NewCmdCleanup provides a cobra command wrapping CleanupOptions

Types

type CleanupOptions

type CleanupOptions struct {
	PrintFlags *genericclioptions.PrintFlags

	PrintObject printers.ResourcePrinterFunc

	RawConfig       *clientcmdapi.Config // the starting kubeconfig
	ResultingConfig *clientcmdapi.Config // holds configs we are keeping
	CleanedUpConfig *clientcmdapi.Config // holds configs that were removed

	CleanupIgnoreConfig *v1.ConfigMap
	IgnoreContexts      []string

	ConnectTimeoutSeconds int
	KubeconfigPath        string
	CleanupUsers          bool
	CleanupClusters       bool
	PrintRaw              bool
	PrintRemoved          bool

	genericclioptions.IOStreams
}

CleanupOptions holds configs used to cleanup a kubeconfig file

func (*CleanupOptions) Complete

func (o *CleanupOptions) Complete(cmd *cobra.Command, args []string) error

Complete sets all information required for cleaning up the current KUBECONFIG

func (*CleanupOptions) NewRestClientForContext added in v0.4.0

func (o *CleanupOptions) NewRestClientForContext(ctxname string) (*kubernetes.Clientset, error)

NewRestClientForContext initializes an API server REST client from a given context

func (*CleanupOptions) Run

func (o *CleanupOptions) Run() error

Run cleans up the user's current KUBECONFIG and prints the result to stdout

func (*CleanupOptions) Validate

func (o *CleanupOptions) Validate() error

Validate ensures that all required arguments and flag values are provided

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL