fixup! refactor(container): restart handling

This commit is contained in:
Rob Watson 2025-04-13 05:14:58 +02:00
parent 23b669cbff
commit 888aadbdc0

View File

@ -526,10 +526,12 @@ func (a *Client) removeContainer(ctx context.Context, id string) error {
if ok { if ok {
cancel() cancel()
} else { } else {
// This shouldn't happen, but we prefer the Docker engine to be the // It is attempted to keep track of cancel functions for each container,
// definitive source of truth and not the cancelFuncs map so don't sweat it // which allow clean cancellation of container restart logic during
// if it doesn't exist. // removal. But there are legitimate occasions where the cancel function
a.logger.Warn("removeContainer: cancelFunc not found", "id", shortID(id)) // would not exist (e.g. during startup check) and in general the state of
// the Docker engine is preferred to local state in this package.
a.logger.Debug("removeContainer: cancelFunc not found", "id", shortID(id))
} }
a.logger.Info("Stopping container", "id", shortID(id)) a.logger.Info("Stopping container", "id", shortID(id))