feat(healthcheck): error log for teapot
All checks were successful
submodules sync / sync (push) Successful in 30s
build / build (push) Successful in 59s
build / trigger-build-image (push) Successful in 6s

This commit is contained in:
张泊明518370910136 2025-01-31 20:06:08 -05:00
parent 55c53ea124
commit 45b4bdd369
GPG Key ID: D47306D7062CDA9D

View File

@ -33,15 +33,15 @@ func runTeapot(conf *conf.Conf) (checkResults []CheckResult, err error) {
conf.Teapot.ScoreboardPath,
"--group-config", strings.Join(formattedGroups, ","),
}
slog.Debug("teapot check args", "args", args)
var stdoutBuf, stderrBuf bytes.Buffer
cmd := exec.Command("joint-teapot", args...) // #nosec G204
cmd.Stdout = &stdoutBuf
cmd.Stderr = &stderrBuf
err = cmd.Run()
slog.Debug("teapot check exec",
"stdout", stdoutBuf.String(), "stderr", stderrBuf.String())
if err != nil {
slog.Error("teapot check args", "args", args)
slog.Error("teapot check exec",
"stdout", stdoutBuf.String(), "stderr", stderrBuf.String())
slog.Error("teapot check exec", "error", err)
return
}