From 724a3bf56e8f04ba2f57a9d662538daec69c4c5a Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 17 Jul 2023 15:22:32 +0300 Subject: [PATCH] Fix agent config reading error handling (#2008) Currently for non-existing config file it would report error instead of info message --- cmd/agent/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/agent/config.go b/cmd/agent/config.go index e477099fa..d29f17008 100644 --- a/cmd/agent/config.go +++ b/cmd/agent/config.go @@ -38,7 +38,7 @@ func readAgentConfig(agentConfigPath string) AgentConfig { rawAgentConf, err := os.ReadFile(agentConfigPath) if err != nil { - if !os.IsNotExist(err) { + if os.IsNotExist(err) { log.Info().Msgf("no agent config found at '%s', start with defaults", agentConfigPath) } else { log.Error().Err(err).Msgf("could not open agent config at '%s'", agentConfigPath)