update exit code for sd

Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
This commit is contained in:
jessicagreben 2021-12-18 04:44:13 -08:00
parent 99bb56fc46
commit 59f7ef06d0

View file

@ -74,7 +74,7 @@ func CheckSD(sdConfigFiles, sdJobName string, sdTimeout time.Duration) int {
d, err := cfg.NewDiscoverer(discovery.DiscovererOptions{Logger: logger}) d, err := cfg.NewDiscoverer(discovery.DiscovererOptions{Logger: logger})
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, "Could not create new discoverer", err) fmt.Fprintln(os.Stderr, "Could not create new discoverer", err)
return configErrExitCode return failureExitCode
} }
go d.Run(ctx, targetGroupChan) go d.Run(ctx, targetGroupChan)
} }
@ -100,7 +100,7 @@ outerLoop:
res, err := json.MarshalIndent(results, "", " ") res, err := json.MarshalIndent(results, "", " ")
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "Could not marshal result json: %s", err) fmt.Fprintf(os.Stderr, "Could not marshal result json: %s", err)
return configErrExitCode return failureExitCode
} }
fmt.Printf("%s", res) fmt.Printf("%s", res)