patch

package
v0.0.0-...-210f5be Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPatchMaker = NewPatchMaker(DefaultAnnotator)

Functions

func DeleteNullInJson

func DeleteNullInJson(jsonBytes []byte) ([]byte, map[string]interface{}, error)

Types

type Annotator

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

func NewAnnotator

func NewAnnotator(key string) *Annotator

func (*Annotator) GetModifiedConfiguration

func (a *Annotator) GetModifiedConfiguration(obj rtclient.Object, annotate bool) ([]byte, error)

GetModifiedConfiguration retrieves the modified configuration of the object. If annotate if true, it embeds the result as an annotation in the modified configuration. If an object was read from the command input, it will use that version of the object. Otherwise, it will use the version from the server.

func (*Annotator) GetOriginalConfiguration

func (a *Annotator) GetOriginalConfiguration(obj rtclient.Object) ([]byte, error)

func (*Annotator) SetLastAppliedAnnotation

func (a *Annotator) SetLastAppliedAnnotation(obj rtclient.Object) error

func (*Annotator) SetOriginalConfiguration

func (a *Annotator) SetOriginalConfiguration(obj runtime.Object, original []byte) error

type CalculateOption

type CalculateOption func([]byte, []byte) ([]byte, []byte, error)

func IgnoreDeployReplicasFields

func IgnoreDeployReplicasFields() CalculateOption

func IgnoreStatefulSetReplicasFields

func IgnoreStatefulSetReplicasFields() CalculateOption

func IgnoreStatusFields

func IgnoreStatusFields() CalculateOption

func IgnoreVolumeClaimTemplateTypeMetaAndStatus

func IgnoreVolumeClaimTemplateTypeMetaAndStatus() CalculateOption

type PatchMaker

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

func NewPatchMaker

func NewPatchMaker(annotator *Annotator) *PatchMaker

func (*PatchMaker) Calculate

func (p *PatchMaker) Calculate(currentObj, modifiedObj rtclient.Object, opts ...CalculateOption) (*PatchResult, error)

type PatchResult

type PatchResult struct {
	Patch    []byte
	Current  []byte
	Modified []byte
	Original []byte
}

func (*PatchResult) IsEmpty

func (p *PatchResult) IsEmpty() bool

Jump to

Keyboard shortcuts

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