mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
agent: Don't print errors on exit 0 in supervisor mode (#20880)
This commit is contained in:
committed by
GitHub
parent
fe53c4684c
commit
8ff31f32a5
@@ -838,16 +838,21 @@ func (c *AgentCommand) Run(args []string) int {
|
||||
|
||||
var exitCode int
|
||||
if err := g.Run(); err != nil {
|
||||
c.logger.Error("runtime error encountered", "error", err)
|
||||
c.UI.Error("Error encountered during run, refer to logs for more details.")
|
||||
var processExitError *exec.ProcessExitError
|
||||
if errors.As(err, &processExitError) {
|
||||
exitCode = processExitError.ExitCode
|
||||
} else {
|
||||
exitCode = 1
|
||||
}
|
||||
|
||||
if exitCode != 0 {
|
||||
c.logger.Error("runtime error encountered", "error", err, "exitCode", exitCode)
|
||||
c.UI.Error("Error encountered during run, refer to logs for more details.")
|
||||
}
|
||||
}
|
||||
|
||||
c.notifySystemd(systemd.SdNotifyStopping)
|
||||
|
||||
return exitCode
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user