fix: controller incorrectly detecting diff during app normalization (cherry-pick #27002 for 3.3) (#27013)

Signed-off-by: Alexander Matyushentsev <alexander@akuity.io>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
This commit is contained in:
argo-cd-cherry-pick-bot[bot] 2026-03-25 14:12:43 -07:00 committed by GitHub
parent b8b5ea6117
commit 4a823fecf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1846,7 +1846,7 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo
logCtx = logCtx.WithField(k, v.Milliseconds())
}
ctrl.normalizeApplication(origApp, app)
ctrl.normalizeApplication(app)
ts.AddCheckpoint("normalize_application_ms")
tree, err := ctrl.setAppManagedResources(destCluster, app, compareResult)
@ -2085,7 +2085,8 @@ func (ctrl *ApplicationController) refreshAppConditions(app *appv1.Application)
}
// normalizeApplication normalizes an application.spec and additionally persists updates if it changed
func (ctrl *ApplicationController) normalizeApplication(orig, app *appv1.Application) {
func (ctrl *ApplicationController) normalizeApplication(app *appv1.Application) {
orig := app.DeepCopy()
app.Spec = *argo.NormalizeApplicationSpec(&app.Spec)
logCtx := log.WithFields(applog.GetAppLogFields(app))