1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

add test case for premature termination before health check completes

This commit is contained in:
Mathieu Fenniak 2025-08-05 20:54:44 -06:00
parent 12347b019d
commit aa70cb7d7b
5 changed files with 38 additions and 3 deletions

View file

@ -18,6 +18,7 @@ import (
"time"
"github.com/Masterminds/semver"
cerrdefs "github.com/containerd/errdefs"
"github.com/docker/cli/cli/compose/loader"
"github.com/docker/cli/cli/connhelper"
"github.com/docker/docker/api/types"
@ -194,6 +195,9 @@ func (cr *containerReference) Remove() common.Executor {
func (cr *containerReference) GetHealth(ctx context.Context) (Health, error) {
resp, err := cr.cli.ContainerInspect(ctx, cr.id)
if cerrdefs.IsNotFound(err) {
return HealthUnHealthy, ErrContainerNotFound
}
logger := common.Logger(ctx)
if err != nil {
return HealthUnHealthy, err