This section is empty.


This section is empty.


func RemoveMapFields

func RemoveMapFields(config, live map[string]interface{}) map[string]interface{}

RemoveMapFields remove all non-existent fields in the live that don't exist in the config


type DiffResult

type DiffResult struct {
	Diff     gojsondiff.Diff
	Modified bool

func Diff

func Diff(config, live *unstructured.Unstructured) *DiffResult

Diff performs a diff on two unstructured objects. If the live object happens to have a "", then perform a three way diff.

func ThreeWayDiff

func ThreeWayDiff(orig, config, live *unstructured.Unstructured) *DiffResult

ThreeWayDiff performs a diff with the understanding of how to incorporate the last-applied-configuration annotation in the diff.

func TwoWayDiff

func TwoWayDiff(config, live *unstructured.Unstructured) *DiffResult

TwoWayDiff performs a normal two-way diff between two unstructured objects. Ignores extra fields in the live object.

func (*DiffResult) ASCIIFormat

func (d *DiffResult) ASCIIFormat(left *unstructured.Unstructured, formatOpts formatter.AsciiFormatterConfig) (string, error)

ASCIIFormat returns the ASCII format of the diff

type DiffResultList

type DiffResultList struct {
	Diffs    []DiffResult
	Modified bool

func DiffArray

func DiffArray(configArray, liveArray []*unstructured.Unstructured) (*DiffResultList, error)

DiffArray performs a diff on a list of unstructured objects. Objects are expected to match environments

Source Files