diff

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchObjectLists added in v0.5.3

func MatchObjectLists(leftObjs, rightObjs []*unstructured.Unstructured) ([]*unstructured.Unstructured, []*unstructured.Unstructured)

MatchObjectLists takes two possibly disjoint lists of Unstructured objects, and returns two new lists of equal lengths, filled out with nils from missing objects in the opposite list. These lists can then be passed into DiffArray for comparison

Types

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 "kubectl.kubernetes.io/last-applied-configuration", then perform a three way diff.

func ThreeWayDiff added in v0.4.0

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 added in v0.4.0

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

Jump to

Keyboard shortcuts

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