patcher

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

type Helper struct {
	// contains filtered or unexported fields
}

Helper is a utility for ensuring the proper patching of objects.

func NewHelper

func NewHelper(obj runtime.Object, crClient client.Client) (*Helper, error)

NewHelper returns an initialized Helper

func (*Helper) Patch

func (h *Helper) Patch(ctx context.Context, obj client.Object, opts ...Option) error

Patch will attempt to patch the given object, including its status.

type HelperOptions

type HelperOptions struct {
	// IncludeStatusObservedGeneration sets the status.observedGeneration field
	// on the incoming object to match metadata.generation, only if there is a change.
	IncludeStatusObservedGeneration bool
}

HelperOptions contains options for patch options.

type Option

type Option interface {
	// ApplyToHelper applies this configuration to the given Helper options.
	ApplyToHelper(*HelperOptions)
}

Option is some configuration that modifies options for a patch request.

type WithStatusObservedGeneration

type WithStatusObservedGeneration struct{}

WithStatusObservedGeneration sets the status.observedGeneration field on the incoming object to match metadata.generation, only if there is a change.

func (WithStatusObservedGeneration) ApplyToHelper

func (w WithStatusObservedGeneration) ApplyToHelper(in *HelperOptions)

ApplyToHelper applies this configuration to the given HelperOptions.

Jump to

Keyboard shortcuts

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