Documentation ¶
Index ¶
- func NewCmdApply(baseName string, f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command
- type ApplyOptions
- func (o *ApplyOptions) ApplyOneObject(info *resource.Info) error
- func (o *ApplyOptions) Complete(f cmdutil.Factory) error
- func (o *ApplyOptions) CompleteFlags(f cmdutil.Factory, cmd *cobra.Command) error
- func (o *ApplyOptions) GetObjects() ([]*resource.Info, error)
- func (o *ApplyOptions) Run() error
- func (o *ApplyOptions) SetObjects(infos []*resource.Info)
- type Patcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdApply ¶
func NewCmdApply(baseName string, f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command
NewCmdApply creates the `apply` command
Types ¶
type ApplyOptions ¶
type ApplyOptions struct { PrintFlags *genericclioptions.PrintFlags ToPrinter func(string) (printers.ResourcePrinter, error) DeleteFlags *delete.DeleteFlags DeleteOptions *delete.DeleteOptions ServerSideApply bool ForceConflicts bool FieldManager string Selector string DryRunStrategy cmdutil.DryRunStrategy DryRunVerifier resource.Verifier All bool Overwrite bool OpenAPIPatch bool PruneWhitelist []string Validator validation.Schema Builder *resource.Builder Mapper meta.RESTMapper DynamicClient dynamic.Interface OpenAPISchema openapi.Resources Namespace string EnforceNamespace bool genericclioptions.IOStreams // contains filtered or unexported fields }
ApplyOptions defines flags and other configuration parameters for the `apply` command
func NewApplyOptions ¶
func NewApplyOptions(ioStreams genericclioptions.IOStreams) *ApplyOptions
NewApplyOptions creates new ApplyOptions for the `apply` command
func (*ApplyOptions) ApplyOneObject ¶
func (o *ApplyOptions) ApplyOneObject(info *resource.Info) error
func (*ApplyOptions) Complete ¶
func (o *ApplyOptions) Complete(f cmdutil.Factory) error
Complete verifies if ApplyOptions are valid and without conflicts.
func (*ApplyOptions) CompleteFlags ¶
CompleteFlags verifies if ApplyOptions are valid and without conflicts.
func (*ApplyOptions) GetObjects ¶
func (o *ApplyOptions) GetObjects() ([]*resource.Info, error)
GetObjects returns a (possibly cached) version of all the valid objects to apply as a slice of pointer to resource.Info and an error if one or more occurred. IMPORTANT: This function can return both valid objects AND an error, since "ContinueOnError" is set on the builder. This function should not be called until AFTER the "complete" and "validate" methods have been called to ensure that the ApplyOptions is filled in and valid.
func (*ApplyOptions) SetObjects ¶
func (o *ApplyOptions) SetObjects(infos []*resource.Info)
SetObjects stores the set of objects (as resource.Info) to be subsequently applied.
type Patcher ¶
type Patcher struct { Mapping *meta.RESTMapping Helper *resource.Helper DynamicClient dynamic.Interface Overwrite bool BackOff clockwork.Clock Force bool Cascade bool Timeout time.Duration GracePeriod int ServerDryRun bool // If set, forces the patch against a specific resourceVersion ResourceVersion *string // Number of retries to make if the patch fails with conflict Retries int OpenapiSchema openapi.Resources }
Patcher defines options to patch OpenAPI objects.
func (*Patcher) Patch ¶
func (p *Patcher) Patch(current runtime.Object, modified []byte, source, namespace, name string, errOut io.Writer) ([]byte, runtime.Object, error)
Patch tries to patch an OpenAPI resource. On success, returns the merge patch as well the final patched object. On failure, returns an error.