From ddaec9b709c330a4273db4aa168ddd06b52e6af1 Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:48:42 -0400 Subject: [PATCH] Update controllers/configurationpolicy_controller.go Co-authored-by: Matt Prahl --- controllers/configurationpolicy_controller.go | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) 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 } }