github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/libpod/define/healthchecks.go (about)

     1  package define
     2  
     3  const (
     4  	// HealthCheckHealthy describes a healthy container
     5  	HealthCheckHealthy string = "healthy"
     6  	// HealthCheckUnhealthy describes an unhealthy container
     7  	HealthCheckUnhealthy string = "unhealthy"
     8  	// HealthCheckStarting describes the time between when the container starts
     9  	// and the start-period (time allowed for the container to start and application
    10  	// to be running) expires.
    11  	HealthCheckStarting string = "starting"
    12  )
    13  
    14  // HealthCheckStatus represents the current state of a container
    15  type HealthCheckStatus int
    16  
    17  const (
    18  	// HealthCheckSuccess means the health worked
    19  	HealthCheckSuccess HealthCheckStatus = iota
    20  	// HealthCheckFailure means the health ran and failed
    21  	HealthCheckFailure HealthCheckStatus = iota
    22  	// HealthCheckContainerStopped means the health check cannot
    23  	// be run because the container is stopped
    24  	HealthCheckContainerStopped HealthCheckStatus = iota
    25  	// HealthCheckContainerNotFound means the container could
    26  	// not be found in local store
    27  	HealthCheckContainerNotFound HealthCheckStatus = iota
    28  	// HealthCheckNotDefined means the container has no health
    29  	// check defined in it
    30  	HealthCheckNotDefined HealthCheckStatus = iota
    31  	// HealthCheckInternalError means some something failed obtaining or running
    32  	// a given health check
    33  	HealthCheckInternalError HealthCheckStatus = iota
    34  	// HealthCheckDefined means the healthcheck was found on the container
    35  	HealthCheckDefined HealthCheckStatus = iota
    36  )
    37  
    38  // Healthcheck defaults.  These are used both in the cli as well in
    39  // libpod and were moved from cmd/podman/common
    40  const (
    41  	// DefaultHealthCheckInterval default value
    42  	DefaultHealthCheckInterval = "30s"
    43  	// DefaultHealthCheckRetries default value
    44  	DefaultHealthCheckRetries uint = 3
    45  	// DefaultHealthCheckStartPeriod default value
    46  	DefaultHealthCheckStartPeriod = "0s"
    47  	// DefaultHealthCheckTimeout default value
    48  	DefaultHealthCheckTimeout = "30s"
    49  )