Documentation ¶
Index ¶
- func CreateMessage(labels map[string]string) string
- func NewPrintErrorAfter(errs io.Writer, prefixForError PrefixForError) func(*unstructured.Unstructured, error) bool
- func NoOp(obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
- type AfterFunc
- type Bulk
- type BulkAction
- func (b *BulkAction) BindForAction(flags *pflag.FlagSet)
- func (b *BulkAction) BindForOutput(flags *pflag.FlagSet, skippedFlags ...string)
- func (b *BulkAction) Compact()
- func (b *BulkAction) DefaultIndent() string
- func (b *BulkAction) Run(list *kapi.List, namespace string) []error
- func (b *BulkAction) ShouldPrint() bool
- func (b *BulkAction) Verbose() bool
- func (b BulkAction) WithMessage(action, individual string) Runner
- func (b BulkAction) WithMessageAndPrefix(action, individual string, prefixForError PrefixForError) Runner
- type Creator
- type IgnoreErrorFunc
- type OpFunc
- type PrefixForError
- type RetryFunc
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMessage ¶
func NewPrintErrorAfter ¶
func NewPrintErrorAfter(errs io.Writer, prefixForError PrefixForError) func(*unstructured.Unstructured, error) bool
func NoOp ¶
func NoOp(obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
Types ¶
type AfterFunc ¶
type AfterFunc func(*unstructured.Unstructured, error) bool
AfterFunc takes an info and an error, and returns true if processing should stop.
func HaltOnError ¶
type Bulk ¶
type Bulk struct { Scheme *runtime.Scheme Op OpFunc After AfterFunc Retry RetryFunc IgnoreError IgnoreErrorFunc }
Bulk provides helpers for iterating over a list of items
type BulkAction ¶
type BulkAction struct { // required setup Bulk Bulk // flags Output string DryRun bool StopOnError bool // output modifiers Action string genericclioptions.IOStreams }
func (*BulkAction) BindForAction ¶
func (b *BulkAction) BindForAction(flags *pflag.FlagSet)
BindForAction sets flags on this action for when setting -o should only change how the operation results are displayed. Passing -o is changing the default output format.
func (*BulkAction) BindForOutput ¶
func (b *BulkAction) BindForOutput(flags *pflag.FlagSet, skippedFlags ...string)
BindForOutput sets flags on this action for when setting -o will not execute the action (the point of the action is primarily to generate the output). Passing -o is asking for output, not execution.
func (*BulkAction) Compact ¶
func (b *BulkAction) Compact()
Compact sets the output to a minimal set
func (*BulkAction) DefaultIndent ¶
func (b *BulkAction) DefaultIndent() string
func (*BulkAction) ShouldPrint ¶
func (b *BulkAction) ShouldPrint() bool
ShouldPrint returns true if an external printer should handle this action instead of execution.
func (*BulkAction) Verbose ¶
func (b *BulkAction) Verbose() bool
func (BulkAction) WithMessage ¶
func (b BulkAction) WithMessage(action, individual string) Runner
func (BulkAction) WithMessageAndPrefix ¶
func (b BulkAction) WithMessageAndPrefix(action, individual string, prefixForError PrefixForError) Runner
type Creator ¶
type Creator struct { Client dynamic.Interface RESTMapper meta.RESTMapper }
func (Creator) Create ¶
func (c Creator) Create(obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
Create is the default create operation for a generic resource.
type IgnoreErrorFunc ¶
IgnoreErrorFunc provides a way to filter errors during the Bulk.Run. If this function returns true the error will NOT be added to the slice of errors returned by Bulk.Run.
This may be used in conjunction with BulkAction.WithMessageAndPrefix if you are reporting some errors as warnings.
type OpFunc ¶
type OpFunc func(obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
OpFunc takes the provided info and attempts to perform the operation
type PrefixForError ¶
PrefixForError allows customization of the prefix that will be printed for any error that occurs in the BulkAction.
type RetryFunc ¶
type RetryFunc func(obj *unstructured.Unstructured, err error) *unstructured.Unstructured
RetryFunc can retry the operation a single time by returning a non-nil object. TODO: make this a more general retry "loop" function rather than one time.