diff

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: UPL-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareIgnoreTargetEmpties

func CompareIgnoreTargetEmpties(liveObject interface{}, desiredObject interface{}) string

CompareIgnoreTargetEmpties diffs two Golang objects recursively, but treats any elements whose values are empty in the 'desiredObject' as "no diff". This is useful in a particular situation of comparing Kubernetes objects:

  1. The 'desiredObject' is constructed via code. It will almost certainly have many, many (nested) empty values.
  2. It is compared against a 'liveObject', which has been retrieved live from the Kubernetes API, and has many of these empty values populated with (k8s-generated) default values.

In this situation, to determine whether our desiredObject is truly different than the liveObject, we ignore processing of elements whose values are empty in the desiredObject.

Types

This section is empty.

Jump to

Keyboard shortcuts

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