replace config exit code with failure exit code

Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
This commit is contained in:
jessicagreben 2021-12-30 05:37:57 -08:00
parent 59f7ef06d0
commit 4b03fa3100
2 changed files with 3 additions and 4 deletions

View file

@ -57,9 +57,8 @@ import (
) )
const ( const (
successExitCode = 0 successExitCode = 0
failureExitCode = 1 failureExitCode = 1
configErrExitCode = 2
// Exit code 3 is used for "one or more lint issues detected". // Exit code 3 is used for "one or more lint issues detected".
lintErrExitCode = 3 lintErrExitCode = 3
) )

View file

@ -43,7 +43,7 @@ func CheckSD(sdConfigFiles, sdJobName string, sdTimeout time.Duration) int {
cfg, err := config.LoadFile(sdConfigFiles, false, false, logger) cfg, err := config.LoadFile(sdConfigFiles, false, false, logger)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, "Cannot load config", err) fmt.Fprintln(os.Stderr, "Cannot load config", err)
return configErrExitCode return failureExitCode
} }
var scrapeConfig *config.ScrapeConfig var scrapeConfig *config.ScrapeConfig