Documentation ¶
Index ¶
- func ClientMapperFromConfig(config *rest.Config) resource.ClientMapperFunc
- func Create(info *resource.Info, namespace string, obj runtime.Object) (runtime.Object, error)
- func CreateMessage(labels map[string]string) string
- func NewPrintErrorAfter(mapper meta.RESTMapper, errs io.Writer, prefixForError PrefixForError) func(*resource.Info, error) bool
- func NoOp(info *resource.Info, namespace string, obj runtime.Object) (runtime.Object, error)
- func PreferredSerializationOrder(client discovery.DiscoveryInterface) []schema.GroupVersionKind
- type AfterFunc
- type Bulk
- type BulkAction
- func (b *BulkAction) BindForAction(flags *pflag.FlagSet)
- func (b *BulkAction) BindForOutput(flags *pflag.FlagSet)
- 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 IgnoreErrorFunc
- type Mapper
- type OpFunc
- type PrefixForError
- type RetryFunc
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientMapperFromConfig ¶
func ClientMapperFromConfig(config *rest.Config) resource.ClientMapperFunc
ClientMapperFromConfig returns a ClientMapper suitable for Bulk operations. TODO: copied from pkg/cmd/util/clientcmd/factory_object_mapping.go#ClientForMapping and vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/factory_object_mapping.go#ClientForMapping
func CreateMessage ¶ added in v1.3.0
func NewPrintErrorAfter ¶ added in v1.0.7
func NewPrintErrorAfter(mapper meta.RESTMapper, errs io.Writer, prefixForError PrefixForError) func(*resource.Info, error) bool
func PreferredSerializationOrder ¶
func PreferredSerializationOrder(client discovery.DiscoveryInterface) []schema.GroupVersionKind
PreferredSerializationOrder returns the preferred ordering via discovery. If anything fails, it just returns a list of with the empty (legacy) group
Types ¶
type AfterFunc ¶ added in v1.0.8
AfterFunc takes an info and an error, and returns true if processing should stop.
func HaltOnError ¶ added in v1.0.8
func NewPrintNameOrErrorAfterIndent ¶ added in v1.0.7
func NewPrintNameOrErrorAfterIndent(mapper meta.RESTMapper, short bool, operation string, out, errs io.Writer, dryRun bool, indent string, prefixForError PrefixForError) AfterFunc
type Bulk ¶
type Bulk struct { Mapper Mapper // PreferredSerializationOrder take a list of GVKs to decide how to serialize out the individual list items // It allows partial values, so you specify just groups or versions as a for instance PreferredSerializationOrder []schema.GroupVersionKind Op OpFunc After AfterFunc Retry RetryFunc IgnoreError IgnoreErrorFunc }
Bulk provides helpers for iterating over a list of items
type BulkAction ¶ added in v1.3.0
type BulkAction struct { // required setup Bulk Bulk Out, ErrOut io.Writer // flags Output string DryRun bool StopOnError bool // output modifiers Action string }
func (*BulkAction) BindForAction ¶ added in v1.3.0
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 ¶ added in v1.3.0
func (b *BulkAction) BindForOutput(flags *pflag.FlagSet)
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 ¶ added in v1.3.0
func (b *BulkAction) Compact()
Compact sets the output to a minimal set
func (*BulkAction) DefaultIndent ¶ added in v1.3.0
func (b *BulkAction) DefaultIndent() string
func (*BulkAction) Run ¶ added in v1.3.0
func (b *BulkAction) Run(list *kapi.List, namespace string) []error
func (*BulkAction) ShouldPrint ¶ added in v1.3.0
func (b *BulkAction) ShouldPrint() bool
ShouldPrint returns true if an external printer should handle this action instead of execution.
func (*BulkAction) Verbose ¶ added in v1.3.0
func (b *BulkAction) Verbose() bool
func (BulkAction) WithMessage ¶ added in v1.3.0
func (b BulkAction) WithMessage(action, individual string) Runner
func (BulkAction) WithMessageAndPrefix ¶ added in v1.4.0
func (b BulkAction) WithMessageAndPrefix(action, individual string, prefixForError PrefixForError) Runner
type IgnoreErrorFunc ¶ added in v1.4.0
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 Mapper ¶ added in v1.3.0
type Mapper interface { meta.RESTMapper InfoForObject(obj runtime.Object, preferredGVKs []schema.GroupVersionKind) (*resource.Info, error) }
Mapper is an interface testability that is equivalent to resource.Mapper
type PrefixForError ¶ added in v1.4.0
PrefixForError allows customization of the prefix that will be printed for any error that occurs in the BulkAction.