Documentation ¶
Overview ¶
Package kmp wraps github.com/google/go-cmp with custom Comparers for frequently used kubernetes resources that have unexported fields.
Index ¶
- func CompareSetFields(x, y interface{}, opts ...cmp.Option) ([]string, error)
- func SafeDiff(x, y interface{}, opts ...cmp.Option) (diff string, err error)
- func SafeEqual(x, y interface{}, opts ...cmp.Option) (equal bool, err error)
- func ShortDiff(prev, cur interface{}, opts ...cmp.Option) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareSetFields ¶
CompareSetFields returns a list of field names that differ between x and y. Uses SafeEqual for comparison.
func SafeDiff ¶
SafeDiff wraps cmp.Diff but recovers from panics and uses custom Comparers for: * k8s.io/apimachinery/pkg/api/resource.Quantity SafeDiff should be used instead of cmp.Diff in non-test code to protect the running process from crashing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.