cleanup

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 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(in io.Reader, out, errout io.Writer) *cobra.Command

NewCmdCleanup provides a cobra command wrapping CleanupOptions

Types

type Options

type Options 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 *k8sv1.ConfigMap
	IgnoreContexts      []string

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

	genericclioptions.IOStreams
}

Options holds configs used to cleanup a kubeconfig file

func (*Options) Complete

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

Complete sets all information required for cleaning up the current KUBECONFIG

func (*Options) NewRestClientForContext

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

NewRestClientForContext initializes an API server REST client from a given context

func (*Options) Run

func (o *Options) Run() error

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

func (*Options) Validate

func (o *Options) 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