DockerCLI/cli
Alano Terblanche 30a73ff19c
fix: ctx should cancel image pull on run
This patch fixes the context cancellation
behaviour for the `runContainer` function,
specifically the `createContainer` function
introduced in this commit 991b1303da.

It delays stripping the `cancel` from the context
passed into the `runContainer` function so that
the `createContainer` function can be cancelled
gracefully by a SIGTERM/SIGINT.

This is especially true when the requested image
does not exist and `docker run` needs to `pull`
the image before creating the container.

Although this patch does gracefully cancel
the `runContainer` function it does not address
the root cause. Some functions in the call path
are not context aware, such as `pullImage`.

Future work would still be necessary to ensure
a consistent behaviour in the CLI.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
2024-11-28 09:53:04 +01:00
..
command fix: ctx should cancel image pull on run 2024-11-28 09:53:04 +01:00
compose update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
config cli/config: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
connhelper cli/connhelper: getConnectionHelper: move ssh-option funcs out of closure 2024-08-12 17:28:32 +02:00
context update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
debug command: include default otel error handler for the cli 2024-04-03 12:01:28 -05:00
flags cli: move "config" flag to cli/flags/ClientOptions.InstallFlags() 2023-06-28 16:04:09 +02:00
hints cli/hints: add tests 2024-10-19 00:48:16 +02:00
internal/oauth update go:build tags to use go1.22 2024-11-12 12:38:18 +01:00
manifest cli/manifest: remove redundant capturing of loop vars in tests (copyloopvar) 2024-11-05 10:14:30 +01:00
registry/client use local ConvertToHostname() implementation 2024-06-14 00:25:21 +02:00
streams cli/streams: minor refactoring and docs touch-ups 2023-04-03 11:27:26 +02:00
trust chore: remove deprecated DualStack field 2024-04-15 17:53:35 +08:00
version Move versioning variables to a separate package. 2019-01-29 11:26:40 +00:00
winresources Use goversioninfo to create Windows Version Info 2021-10-11 16:54:22 +02:00
cobra.go cli: FlagErrorFunc: don't print long usage output for invalid flags 2024-07-17 13:22:31 +02:00
cobra_test.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
error.go cli: remove deprecated Errors type 2024-10-22 10:43:24 +02:00
required.go cli: rename args that collided with builtins (predeclard) 2024-08-26 13:55:28 +02:00
required_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00