patch

package
v0.0.0-...-445da97 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Scheme = runtime.NewScheme()

Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered.

Functions

func GetLastApplied

func GetLastApplied(obj runtime.Object) ([]byte, error)

GetLastApplied retrieves the original configuration of the object from the annotation, or nil if no annotation was found.

func SerializeLastApplied

func SerializeLastApplied(obj runtime.Object, annotate bool) (modified []byte, err error)

SerializeLastApplied returns the json serialization of the incoming object If annotate is true, the returned serialization will contain a serialized annotation of itself (kubectl.kubernetes.io/last-applied-configuration), otherwise it will not have this annotation.

func SetLastApplied

func SetLastApplied(obj runtime.Object) error

SetLastApplied patch

Types

type Patch

type Patch struct {
	Type types.PatchType
	Data []byte
}

Patch encapsulates a Kubernetes patch operation data Patch contains the patch type as well as the patch request contents.

func GetClientSideApplyPatch

func GetClientSideApplyPatch(current, desired runtime.Object) (Patch, error)

GetClientSideApplyPatch updates a resource using the same approach as running `kubectl apply`. The implementation here has been mostly extracted from the apply command: k8s.io/kubernetes/pkg/kubectl/cmd/apply.go

func GetMergePatch

func GetMergePatch(original, modified runtime.Object) (Patch, error)

GetMergePatch - generate merge patch from original and modified objects

Jump to

Keyboard shortcuts

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