diff --git a/pkg/utils/k8sutils.go b/pkg/utils/k8sutils.go index 89cacdb5..f6ce1bb3 100644 --- a/pkg/utils/k8sutils.go +++ b/pkg/utils/k8sutils.go @@ -23,9 +23,9 @@ import ( "fmt" "maps" "os" - "reflect" "time" + "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -153,7 +153,7 @@ func CreateOrReplace(ctx context.Context, c client.Client, obj client.Object, f return err } - if reflect.DeepEqual(existing, obj) { + if equality.Semantic.DeepEqual(existing, obj) { return nil }