Skip to content

Commit a0443aa

Browse files
committed
fix: use semantic equality in CreateOrUpdate
1 parent 198197f commit a0443aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controller/controllerutil/controllerutil.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package controllerutil
1919
import (
2020
"context"
2121
"fmt"
22-
"reflect"
2322

23+
"k8s.io/apimachinery/pkg/api/equality"
2424
"k8s.io/apimachinery/pkg/api/errors"
2525
"k8s.io/apimachinery/pkg/api/meta"
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -157,7 +157,7 @@ func CreateOrUpdate(ctx context.Context, c client.Client, obj runtime.Object, f
157157
return OperationResultNone, err
158158
}
159159

160-
if reflect.DeepEqual(existing, obj) {
160+
if equality.Semantic.DeepEqual(existing, obj) {
161161
return OperationResultNone, nil
162162
}
163163

0 commit comments

Comments
 (0)