fix(start): key the wait-timeout message on errWaitTimeout

start() translated any DeadlineExceeded from the plan into a
dependency-readiness message when --wait-timeout was set, including one
from an engine call or a hook. Use the marker a wait node's own timeout
now carries, as upDetached does.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2026-10-08 11:41:55 +02:00 • committed by Guillaume Lours
parent 0caec9ef7a
commit 13b2300bf3

View file

@ -92,23 +92,7 @@ func (s *composeService) start(ctx context.Context, projectName string, options
exec.waitTimeout = options.WaitTimeout
if err := exec.run(ctx, plan); err != nil {
// Same distinction as upDetached: ctx.Err() == nil rules out ctx's
// own external deadline (unrelated to --wait-timeout) having fired
// during exec.run, so a DeadlineExceeded here can only be one of the
// plan's own OpWaitCondition nodes timing out.
if options.WaitTimeout > 0 && ctx.Err() == nil && errors.Is(err, context.DeadlineExceeded) {
if options.Wait {
return fmt.Errorf("application not healthy after %s", options.WaitTimeout)
}
// No --wait: this is the dependency-timeout failure
// waitDependencies already reports as "timeout waiting for
// dependencies" elsewhere -- matching that established,
// actionable message instead of leaking the raw
// "context deadline exceeded" a user never configured in those
// terms.
return errors.New("timeout waiting for dependencies")
}
return err
return translateWaitTimeout(err)
}
if !options.Wait {