From e3b7132711f65d95c046886f3a568ee92302c7d5 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Mon, 18 Sep 2023 16:36:47 +0200 Subject: [PATCH] move to semantic DeepEquals Signed-off-by: Per Goncalves da Silva --- pkg/controller/operators/olm/operatorgroup.go | 4 +++- pkg/lib/ownerutil/util.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/controller/operators/olm/operatorgroup.go b/pkg/controller/operators/olm/operatorgroup.go index 34b5925761..92c70c649f 100644 --- a/pkg/controller/operators/olm/operatorgroup.go +++ b/pkg/controller/operators/olm/operatorgroup.go @@ -9,6 +9,8 @@ import ( "reflect" "strings" + "k8s.io/apimachinery/pkg/api/equality" + "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -1030,7 +1032,7 @@ func (a *Operator) ensureOpGroupClusterRole(op *operatorsv1.OperatorGroup, suffi } // ensure that the labels and aggregation rules are correct - if labels.Equals(existingRole.Labels, cp.Labels) && reflect.DeepEqual(existingRole.AggregationRule, aggregationRule) { + if labels.Equals(existingRole.Labels, cp.Labels) && equality.Semantic.DeepEqual(existingRole.AggregationRule, aggregationRule) { return nil } diff --git a/pkg/lib/ownerutil/util.go b/pkg/lib/ownerutil/util.go index a07c4f019e..6bbd7eb5f0 100644 --- a/pkg/lib/ownerutil/util.go +++ b/pkg/lib/ownerutil/util.go @@ -2,6 +2,7 @@ package ownerutil import ( "fmt" + log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" rbac "k8s.io/api/rbac/v1"