mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types/container: make HealthStatus a concrete type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -23,7 +23,7 @@ func (s *Health) String() string {
|
||||
case container.Starting:
|
||||
return "health: starting"
|
||||
default: // Healthy and Unhealthy are clear on their own
|
||||
return status
|
||||
return string(status)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ func handleProbeResult(d *Daemon, c *container.Container, result *containertypes
|
||||
|
||||
current := h.Status()
|
||||
if oldStatus != current {
|
||||
d.LogContainerEvent(c, events.Action(string(events.ActionHealthStatus)+": "+current))
|
||||
d.LogContainerEvent(c, events.Action(string(events.ActionHealthStatus)+": "+string(current)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ func (daemon *Daemon) foldFilter(ctx context.Context, view *container.View, conf
|
||||
}
|
||||
|
||||
err = psFilters.WalkValues("health", func(value string) error {
|
||||
if err := containertypes.ValidateHealthStatus(value); err != nil {
|
||||
if err := containertypes.ValidateHealthStatus(containertypes.HealthStatus(value)); err != nil {
|
||||
return errdefs.InvalidParameter(fmt.Errorf("invalid filter 'health=%s': %w", value, err))
|
||||
}
|
||||
return nil
|
||||
@@ -491,7 +491,7 @@ func includeContainerInList(container *container.Snapshot, filter *listContext)
|
||||
}
|
||||
|
||||
// Do not include container if its health doesn't match the filter
|
||||
if !filter.filters.ExactMatch("health", container.Health) {
|
||||
if !filter.filters.ExactMatch("health", string(container.Health)) {
|
||||
return excludeContainer
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user