Skip to content

Commit

Permalink
Fix constantly updating objects with an empty list
Browse files Browse the repository at this point in the history
Similar to some other fixes we had for empty bools, strings, and ints.

Refs:
 - https://issues.redhat.com/browse/ACM-5132

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
  • Loading branch information
JustinKuli committed Apr 25, 2023
1 parent 14a11f9 commit 30d0179
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/configurationpolicy_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func equalObjWithSort(mergedObj interface{}, oldObj interface{}) (areEqual bool)
// this includes the case where oldObj is nil
return false
case []interface{}:
if len(mergedObj) == 0 && oldObj == nil {
return true
}

if oldObjList, ok := oldObj.([]interface{}); ok {
return checkListsMatch(mergedObj, oldObjList)
}
Expand Down

0 comments on commit 30d0179

Please sign in to comment.