compose/pkg/compose
Laura Brehm dcbf005fe4
up: gracefully teardown when command ctx cancelled
Previously, if a long-lived plugin process (such as
an execution of `compose up`) was running and then
detached from a terminal, signalling the parent CLI
process to exit would leave the plugin process behind.

To address this, changes were introduced on the CLI side
(see: https://github.com/docker/cli/pull/4599) to enable
the CLI to notify a running plugin process that it should
exit. This makes it so that, when the parent CLI process
is going to exit, the command context of the plugin
command being executed is cancelled.

This commit takes advantage of these changes by tapping into
the command context's done channel and using it to teardown
on an up.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-12-23 02:49:27 +00:00
..
testdata prefer canonical `compose.yaml` file name 2021-06-22 11:23:57 +02:00
attach.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
build.go introduce build --with-dependencies 2023-12-20 15:58:54 +01:00
build_buildkit.go Improve buildkit node creation (#10843) 2023-08-03 15:11:16 -04:00
build_classic.go project.Services is a map 2023-12-05 18:54:31 +01:00
compose.go avoid use of service.Name when iterating on project.Services 2023-12-05 18:54:31 +01:00
container.go lint: add `nolintlint` and clean up `nolint` directives (#9738) 2022-08-09 16:43:58 -04:00
containers.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
convergence.go avoid use of service.Name when iterating on project.Services 2023-12-05 18:54:31 +01:00
convergence_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
convert.go add support for start_interval 2023-12-07 15:59:22 +01:00
cp.go deps: remove deprecated github.com/pkg/errors 2023-09-29 06:28:58 +02:00
create.go Add support for endpoint-specific MAC address 2023-12-18 12:04:45 +01:00
create_test.go project.Services is a map 2023-12-05 18:54:31 +01:00
dependencies.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
dependencies_test.go project.Services is a map 2023-12-05 18:54:31 +01:00
down.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
down_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
envresolver.go config: case-insensitive env vars on Windows (#9438) 2022-08-02 14:56:09 -04:00
envresolver_test.go ci: remove uses of deprecated gotest.tools v2 (#9935) 2022-11-07 14:07:41 -05:00
errors.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
events.go update to v1.25 for RunAttach 2023-12-05 17:02:37 +01:00
exec.go update to v1.25 for RunAttach 2023-12-05 17:02:37 +01:00
filters.go detect network conflict as name is not guaranteed to be unique (#10612) 2023-05-31 14:46:23 -04:00
hash.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
hash_test.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
image_pruner.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
images.go [lint] don't use deprecated types 2023-12-05 17:02:37 +01:00
kill.go cli: option to write status messages on stdout (#10549) 2023-05-11 12:45:00 -04:00
kill_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
logs.go [lint] don't use deprecated types 2023-12-05 17:02:37 +01:00
logs_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
ls.go [lint] don't use deprecated types 2023-12-05 17:02:37 +01:00
ls_test.go Add unit tests for combinedConfigFiles logic 2022-02-18 16:37:35 +01:00
metrics.go Add gocritic to linters 2022-07-13 19:33:03 +02:00
pause.go cli: option to write status messages on stdout (#10549) 2023-05-11 12:45:00 -04:00
port.go when --index is not set select first service container 2023-07-07 14:08:24 +02:00
printer.go up: fix write/close race condition in logPrinter 2023-12-20 15:45:12 +01:00
ps.go add support for attributes exposed by `docker ps` 2023-08-25 16:36:45 +02:00
ps_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
publish.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
pull.go avoid use of service.Name when iterating on project.Services 2023-12-05 18:54:31 +01:00
push.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
remove.go [lint] don't use deprecated types 2023-12-05 17:02:37 +01:00
restart.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
run.go deps: update docker/cli to fix go version selection issue 2023-12-19 14:15:16 +00:00
scale.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
secrets.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
start.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
stop.go cli: option to write status messages on stdout (#10549) 2023-05-11 12:45:00 -04:00
stop_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
top.go project name MUST be lowercase 2022-04-13 09:49:01 +02:00
up.go up: gracefully teardown when command ctx cancelled 2023-12-23 02:49:27 +00:00
viz.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
viz_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00
wait.go Add `docker compose wait` 2023-06-30 16:07:03 +02:00
watch.go adopt compose-go/v2 2023-12-05 18:54:31 +01:00
watch_test.go github.com/golang/mock is deprecated 2023-12-13 14:47:39 +01:00