Skip to content

Commit

Permalink
fix: sort endpoint_permissions when computing diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
GGabriele committed Mar 20, 2024
1 parent c54ae7a commit 265bbba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/state/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,14 @@ func (r1 *RBACEndpointPermission) EqualWithOpts(r2 *RBACEndpointPermission, igno
r2Copy.CreatedAt = nil
}

sort.Slice(r1Copy.Actions, func(i, j int) bool {
return *r1Copy.Actions[i] < *r1Copy.Actions[j]
})

sort.Slice(r2Copy.Actions, func(i, j int) bool {
return *r2Copy.Actions[i] < *r2Copy.Actions[j]
})

return reflect.DeepEqual(r1Copy, r2Copy)
}

Expand Down

0 comments on commit 265bbba

Please sign in to comment.