From a565e82728a376f70264a1a617411c0f85ecd34f Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:54:37 -0400 Subject: [PATCH] Reduce log spam about errors determining upgrade versions (#42572) --- lib/web/apiserver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/web/apiserver.go b/lib/web/apiserver.go index a285ea8e1b8f9..e1b3d49a96f51 100644 --- a/lib/web/apiserver.go +++ b/lib/web/apiserver.go @@ -1636,7 +1636,9 @@ func (h *Handler) getWebConfig(w http.ResponseWriter, r *http.Request, p httprou var automaticUpgradesTargetVersion string if automaticUpgradesEnabled { automaticUpgradesTargetVersion, err = h.cfg.AutomaticUpgradesChannels.DefaultVersion(r.Context()) - h.log.WithError(err).Error("Cannot read target version") + if err != nil { + h.log.WithError(err).Error("Cannot read target version") + } } webCfg := webclient.WebConfig{