Skip to content

Commit ab402c1

Browse files
authored
Merge pull request kubernetes-sigs#240 from apelisse/equalsusing-in-compare
Use EqualsUsing in Typed.Compare()
2 parents fa1e46d + 6e15532 commit ab402c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

typed/typed.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ func (tv TypedValue) Compare(rhs *TypedValue) (c *Comparison, err error) {
129129
Modified: fieldpath.NewSet(),
130130
Added: fieldpath.NewSet(),
131131
}
132+
a := value.NewFreelistAllocator()
132133
_, err = merge(&tv, rhs, func(w *mergingWalker) {
133134
if w.lhs == nil {
134135
c.Added.Insert(w.path)
135136
} else if w.rhs == nil {
136137
c.Removed.Insert(w.path)
137-
} else if !value.Equals(w.rhs, w.lhs) {
138+
} else if !value.EqualsUsing(a, w.rhs, w.lhs) {
138139
// TODO: Equality is not sufficient for this.
139140
// Need to implement equality check on the value type.
140141
c.Modified.Insert(w.path)

0 commit comments

Comments
 (0)