util

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDryRunFlag

func AddDryRunFlag(cmd *cobra.Command)

AddDryRunFlag adds dry-run flag to a command.

func FlagString

func FlagString(cmd *cobra.Command, flag string) string

func FlagStringArray

func FlagStringArray(cmd *cobra.Command, flag string) []string

func PrintFlagsWithDryRunStrategy

func PrintFlagsWithDryRunStrategy(printFlags *genericclioptions.PrintFlags, dryRunStrategy DryRunStrategy) error

PrintFlagsWithDryRunStrategy sets a success message at print time for the dry run strategy

Types

type ClientGetter

type ClientGetter interface {
	genericclioptions.RESTClientGetter

	KueueClientSet() (versioned.Interface, error)
	K8sClientSet() (k8s.Interface, error)
	NewResourceBuilder() *resource.Builder
}

func NewClientGetter

func NewClientGetter(clientGetter genericclioptions.RESTClientGetter) ClientGetter

type DryRunStrategy

type DryRunStrategy int
const (
	// DryRunNone indicates the client will make all mutating calls
	DryRunNone DryRunStrategy = iota

	// DryRunClient or client-side dry-run, indicates the client will prevent
	// making mutating calls such as CREATE, PATCH, and DELETE
	DryRunClient

	// DryRunServer or server-side dry-run, indicates the client will send
	// mutating calls to the APIServer with the dry-run parameter to prevent
	// persisting changes.
	//
	// Note that clients sending server-side dry-run calls should verify that
	// the APIServer and the resource supports server-side dry-run, and otherwise
	// clients should fail early.
	//
	// If a client sends a server-side dry-run call to an APIServer that doesn't
	// support server-side dry-run, then the APIServer will persist changes inadvertently.
	DryRunServer
)

func GetDryRunStrategy

func GetDryRunStrategy(cmd *cobra.Command) (DryRunStrategy, error)

Jump to

Keyboard shortcuts

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