patches

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutateIfApplicable

func MutateIfApplicable[T runtime.Object](
	obj *unstructured.Unstructured,
	vars map[string]apiextensionsv1.JSON,
	holderRef *runtimehooksv1.HolderReference,
	patchSelector clusterv1.PatchSelector,
	log logr.Logger,
	mutFn func(T) error,
) error

MutateIfApplicable applies the typed mutFn function to the unstructured input if the input matches the holderRef and patchSelector. This is used by handlers to reduce the boilerplate required there.

This function makes it easier for handlers to work with typed objects, while ensuring that patches properly work with minimal input documents. While it would feel more natural to work purely with typed objects, due to the semantics of `omitempty` and non-pointer struct fields, it is required to work with unstructured objects for input and output. This leads to minimal patches, regardless of the completeness of the input type.

Types

This section is empty.

Directories

Path Synopsis
This code re-implements private matcher for CAPI inline patch selector.
This code re-implements private matcher for CAPI inline patch selector.

Jump to

Keyboard shortcuts

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