patch

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLastAppliedConfiguration added in v1.9.0

func AddLastAppliedConfiguration(obj runtime.Object, annoAppliedConfig string, annoAppliedTime string) error

AddLastAppliedConfiguration add last-applied-configuration and last-applied-time annotation

func GetModifiedConfiguration added in v1.9.0

func GetModifiedConfiguration(obj runtime.Object, updateAnnotation bool, annoAppliedConfig string) ([]byte, error)

GetModifiedConfiguration serializes the object into byte stream. If `updateAnnotation` is true, it embeds the result as an annotation in the modified configuration.

func GetOriginalConfiguration added in v1.9.0

func GetOriginalConfiguration(obj runtime.Object, anno string) []byte

GetOriginalConfiguration gets original configuration of the object form the annotation, or nil if no annotation found.

func ThreeWayMergePatch

func ThreeWayMergePatch(currentObj, modifiedObj runtime.Object, a *PatchAction) (client.Patch, error)

ThreeWayMergePatch creates a patch by computing a three way diff based on its current state, modified state, and last-applied-state recorded in the annotation.

Types

type PatchAction

type PatchAction struct {
	// UpdateAnno update the annotation of last-applied-configuration on modifiedObj
	UpdateAnno bool
	// AnnoLastAppliedConfig the annotation key for last-applied-configuration
	AnnoLastAppliedConfig string
	// AnnoLastAppliedTime the annotation key for last-applied-time
	AnnoLastAppliedTime string
}

PatchAction is the action for patch

Jump to

Keyboard shortcuts

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