compare

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreTimestampUpdates = cmp.Comparer(func(x, y metav1.Time) bool {
	return x == emptyTime && y == emptyTime ||
		x != emptyTime && y != emptyTime
})

IgnoreTimestampUpdates ignores timestamps when testing equality, unless one is empty and the other is not.

This is used to test R*Sync equality, because the timestamps get updated every time, even if nothing else changed.

Functions

func GenericResourcesEqual

func GenericResourcesEqual(decoder decode.Decoder, l []v1.GenericResources, r []v1.GenericResources,
	cmpOptions ...cmp.Option) (bool, error)

GenericResourcesEqual returns true if the GenericResources slices are equivalent. Since the GenericResources in the cluster have the RawExtension.Raw field populated and the ones being generated have the RawExtension.Object field populated, we need to decode them to have a common representation for comparing the underlying resources.

func ObjectMetaEqual

func ObjectMetaEqual(left client.Object, right client.Object) bool

ObjectMetaEqual returns true if the Meta field of left and right objects are equal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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