Skip to content

Commit e3b7132

Browse files
author
Per Goncalves da Silva
committed
move to semantic DeepEquals
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent dbacd7a commit e3b7132

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/controller/operators/olm/operatorgroup.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"reflect"
1010
"strings"
1111

12+
"k8s.io/apimachinery/pkg/api/equality"
13+
1214
"github.com/sirupsen/logrus"
1315
corev1 "k8s.io/api/core/v1"
1416
rbacv1 "k8s.io/api/rbac/v1"
@@ -1030,7 +1032,7 @@ func (a *Operator) ensureOpGroupClusterRole(op *operatorsv1.OperatorGroup, suffi
10301032
}
10311033

10321034
// ensure that the labels and aggregation rules are correct
1033-
if labels.Equals(existingRole.Labels, cp.Labels) && reflect.DeepEqual(existingRole.AggregationRule, aggregationRule) {
1035+
if labels.Equals(existingRole.Labels, cp.Labels) && equality.Semantic.DeepEqual(existingRole.AggregationRule, aggregationRule) {
10341036
return nil
10351037
}
10361038

pkg/lib/ownerutil/util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ownerutil
22

33
import (
44
"fmt"
5+
56
log "github.com/sirupsen/logrus"
67
corev1 "k8s.io/api/core/v1"
78
rbac "k8s.io/api/rbac/v1"

0 commit comments

Comments
 (0)