diff --git a/controllers/configurationpolicy_controller.go b/controllers/configurationpolicy_controller.go index 9dd772f1..5390244b 100644 --- a/controllers/configurationpolicy_controller.go +++ b/controllers/configurationpolicy_controller.go @@ -2810,25 +2810,8 @@ func handleKeys( continue } - // check key for mismatch - errorMsg, keyUpdateNeeded, mergedObj, skipped := handleSingleKey( - key, desiredObj, existingObjectCopy, compType, zeroValueEqualsNil, - ) - if errorMsg != "" { - log.Info(errorMsg) - - return true, errorMsg, true, statusMismatch - } - - // If the mergedObj is nil, we'll use the value to erase it from the existing object. - if skipped { - continue - } - - if keyUpdateNeeded { - existingObj.Object[key] = mergedObj - updateNeeded = true - } + delete(existingObj.Object, key) + updateNeeded = true } }