diff --git a/controller/appcontroller.go b/controller/appcontroller.go index 06391b8230ae6..3677195fef772 100644 --- a/controller/appcontroller.go +++ b/controller/appcontroller.go @@ -319,6 +319,19 @@ func (ctrl *ApplicationController) handleObjectUpdated(managedByApp map[string]b if isManagedResource { level = CompareWithRecent } + + // Additional check for debug level so we don't need to evaluate the + // format string in case of non-debug scenarios + if log.GetLevel() >= log.DebugLevel { + var resKey string + if ref.Namespace != "" { + resKey = ref.Namespace + "/" + ref.Name + } else { + resKey = "(cluster-scoped)/" + ref.Name + } + log.Debugf("Refreshing app %s for change in cluster of object %s of type %s/%s", appName, resKey, ref.APIVersion, ref.Kind) + } + ctrl.requestAppRefresh(appName, &level, nil) } }