patch

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizerPatch

func AddFinalizerPatch(obj metav1.Object, finalizers ...string) client.Patch

func FixPathToValid

func FixPathToValid(path string) string

func RemoveFinalizerPatch

func RemoveFinalizerPatch(obj metav1.Object, finalizers ...string) client.Patch

Types

type JSONPatch

type JSONPatch []JSONPatchItem

func Join

func Join(patches ...JSONPatch) *JSONPatch

func NewJSONPatch

func NewJSONPatch(items ...JSONPatchItem) *JSONPatch

func (*JSONPatch) Append

func (jp *JSONPatch) Append(op JSONPatchOperation, path string, val interface{}) *JSONPatch

func (*JSONPatch) Join

func (jp *JSONPatch) Join(patch JSONPatch)

func (*JSONPatch) JsonPatch

func (jp *JSONPatch) JsonPatch() (client.Patch, error)

func (JSONPatch) Len

func (jp JSONPatch) Len() int32

func (*JSONPatch) Marshal

func (jp *JSONPatch) Marshal() ([]byte, error)

func (*JSONPatch) ToClientPatch

func (jp *JSONPatch) ToClientPatch() (client.Patch, error)

type JSONPatchItem

type JSONPatchItem struct {
	Operation JSONPatchOperation `json:"op"`
	Path      string             `json:"path"`
	Value     interface{}        `json:"value"`
}

type JSONPatchOperation

type JSONPatchOperation string
const (
	// If the target location specifies an object member that does exist, that member's value is replaced.
	Add JSONPatchOperation = "add"

	// The target location MUST exist for the operation to be successful.
	Replace JSONPatchOperation = "replace"

	// The target location MUST exist for the operation to be successful.
	Remove JSONPatchOperation = "remove"

	Move JSONPatchOperation = "move"
	Copy JSONPatchOperation = "copy"

	PathSeparator = "/"
)

Jump to

Keyboard shortcuts

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