Skip to content

Commit

Permalink
Log "Forbidden" update errors
Browse files Browse the repository at this point in the history
ref: https://issues.redhat.com/browse/ACM-10612
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
(cherry picked from commit b5b610b)
  • Loading branch information
dhaiducek authored and openshift-merge-bot[bot] committed Mar 25, 2024
1 parent 16448a9 commit 1358f3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/configurationpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2628,6 +2628,8 @@ func (r *ConfigurationPolicyReconciler) checkAndUpdateResource(
// If an inform policy and the update is forbidden (i.e. modifying Pod spec fields), then return
// noncompliant since that confirms some fields don't match.
if k8serrors.IsForbidden(err) {
log.Info(fmt.Sprintf("Dry run update failed with error: %s", err.Error()))

r.setEvaluatedObject(obj.policy, obj.existingObj, false)

return true, "", false, false
Expand Down

0 comments on commit 1358f3f

Please sign in to comment.