summaryrefslogtreecommitdiff
path: root/cmd/podman/healthcheck/run.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-09-10 11:19:59 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-09-10 11:20:01 -0400
commit4fbc5b8fe75b3d486a97c013af7a6b085292b46a (patch)
treea31f855d21de2c3837821a1fa4c7fb386672c177 /cmd/podman/healthcheck/run.go
parente6046224ea88cad9286303456562b4a24ad9cf9b (diff)
downloadpodman-4fbc5b8fe75b3d486a97c013af7a6b085292b46a.tar.gz
podman-4fbc5b8fe75b3d486a97c013af7a6b085292b46a.tar.bz2
podman-4fbc5b8fe75b3d486a97c013af7a6b085292b46a.zip
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 <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/healthcheck/run.go')
-rw-r--r--cmd/podman/healthcheck/run.go5
1 files changed, 3 insertions, 2 deletions
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
}