util

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAllNamespacesFlagVar added in v0.9.0

func AddAllNamespacesFlagVar(cmd *cobra.Command, p *bool)

func AddDryRunFlag

func AddDryRunFlag(cmd *cobra.Command)

AddDryRunFlag adds dry-run flag to a command.

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)
	DynamicClient() (dynamic.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