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 {
cancel()
} else {
// This shouldn't happen, but we prefer the Docker engine to be the
// definitive source of truth and not the cancelFuncs map so don't sweat it
// if it doesn't exist.
a.logger.Warn("removeContainer: cancelFunc not found", "id", shortID(id))
// It is attempted to keep track of cancel functions for each container,
// which allow clean cancellation of container restart logic during
// removal. But there are legitimate occasions where the cancel function
// 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))