Fix agent config reading error handling (#2008)

Currently for non-existing config file it would report error instead of info message
This commit is contained in:
Lauris BH 2023-07-17 15:22:32 +03:00 committed by GitHub
parent 1b646a28b4
commit 724a3bf56e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)