Skip to content

Commit b464eb2

Browse files
rewantsoniopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
controllers: use semantic deepequal
Signed-off-by: Rewant Soni <[email protected]>
1 parent 2c37478 commit b464eb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/utils/k8sutils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import (
2323
"fmt"
2424
"maps"
2525
"os"
26-
"reflect"
2726
"time"
2827

28+
"k8s.io/apimachinery/pkg/api/equality"
2929
"k8s.io/apimachinery/pkg/api/errors"
3030
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3131
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -153,7 +153,7 @@ func CreateOrReplace(ctx context.Context, c client.Client, obj client.Object, f
153153
return err
154154
}
155155

156-
if reflect.DeepEqual(existing, obj) {
156+
if equality.Semantic.DeepEqual(existing, obj) {
157157
return nil
158158
}
159159

0 commit comments

Comments
 (0)