Exit with Code 1 if registering a runner fails #228
|
@ -197,7 +197,7 @@ func registerInteractive(configFile string) error {
|
|||
if stage == StageWaitingForRegistration {
|
||||
log.Infof("Registering runner, name=%s, instance=%s, labels=%v.", inputs.RunnerName, inputs.InstanceAddr, inputs.CustomLabels)
|
||||
if err := doRegister(cfg, inputs); err != nil {
|
||||
log.Errorf("Failed to register runner: %v", err)
|
||||
return fmt.Errorf("Failed to register runner: %w", err)
|
||||
} else {
|
||||
MarkusLoeffler01 marked this conversation as resolved
Outdated
|
||||
log.Infof("Runner registered successfully.")
|
||||
}
|
||||
|
@ -257,8 +257,7 @@ func registerNoInteractive(configFile string, regArgs *registerArgs) error {
|
|||
return nil
|
||||
}
|
||||
if err := doRegister(cfg, inputs); err != nil {
|
||||
log.Errorf("Failed to register runner: %v", err)
|
||||
return nil
|
||||
return fmt.Errorf("Failed to register runner: %w", err)
|
||||
}
|
||||
techknowlogick marked this conversation as resolved
Outdated
wolfogre
commented
Ditto. Ditto.
|
||||
log.Infof("Runner registered successfully.")
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user
thanks for this PR. You may be able to return an error, and Cobra would exit with a non-zero status, I haven't tested this suggestion though.
Maybe: