Skip to content

Commit

Permalink
pkg/client: invert CRB checks
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Sep 17, 2020
1 parent 16813f9 commit aa7b164
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/client/client.go
Expand Up @@ -1102,11 +1102,9 @@ func (c *Client) CreateOrUpdateClusterRoleBinding(crb *rbacv1.ClusterRoleBinding
return errors.Wrap(err, "retrieving ClusterRoleBinding object failed")
}

changed := reflect.DeepEqual(crb.RoleRef, existing.RoleRef)
changed = changed || reflect.DeepEqual(crb.Subjects, existing.Subjects)
changed = changed || reflect.DeepEqual(crb.Labels, existing.Labels)

if !changed {
if reflect.DeepEqual(crb.RoleRef, existing.RoleRef) &&
reflect.DeepEqual(crb.Subjects, existing.Subjects) &&
reflect.DeepEqual(crb.Labels, existing.Labels) {
return nil
}

Expand Down

0 comments on commit aa7b164

Please sign in to comment.