mirror of
https://github.com/containers/podman.git
synced 2025-06-01 01:00:22 +08:00

the api needs to account for image input where the image is encoded as a fqd image name. Signed-off-by: Brent Baude <bbaude@redhat.com>
22 lines
527 B
Go
22 lines
527 B
Go
package libpod
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/containers/libpod/libpod"
|
|
"github.com/containers/libpod/pkg/api/handlers/utils"
|
|
)
|
|
|
|
func RunHealthCheck(w http.ResponseWriter, r *http.Request) {
|
|
runtime := r.Context().Value("runtime").(*libpod.Runtime)
|
|
name := utils.GetName(r)
|
|
status, err := runtime.HealthCheck(name)
|
|
if err != nil {
|
|
if status == libpod.HealthCheckContainerNotFound {
|
|
utils.ContainerNotFound(w, name, err)
|
|
}
|
|
utils.InternalServerError(w, err)
|
|
}
|
|
utils.WriteResponse(w, http.StatusOK, status)
|
|
}
|