From 4fbc5b8fe75b3d486a97c013af7a6b085292b46a Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 10 Sep 2021 11:19:59 -0400 Subject: Stop outputting 'healthy' on healthcheck We should only print unhealthy if the check fails. Currently this is filling logs when users are running lots of healthchecks. Improves: https://github.com/containers/podman/issues/11157 Signed-off-by: Daniel J Walsh --- cmd/podman/healthcheck/run.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/healthcheck/run.go b/cmd/podman/healthcheck/run.go index fe8dc2573..b03a07bc4 100644 --- a/cmd/podman/healthcheck/run.go +++ b/cmd/podman/healthcheck/run.go @@ -6,6 +6,7 @@ import ( "github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/registry" + "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/spf13/cobra" ) @@ -34,9 +35,9 @@ func run(cmd *cobra.Command, args []string) error { if err != nil { return err } - if response.Status == "unhealthy" { + if response.Status == define.HealthCheckUnhealthy { registry.SetExitCode(1) + fmt.Println(response.Status) } - fmt.Println(response.Status) return err } -- cgit v1.2.3-54-g00ecf