compose/cmd/compose
Milas Bowman 61845dd781
logs: filter to services from current Compose file (#9811)
* logs: filter to services from current Compose file

When using the file model, only attach to services
referenced in the active Compose file.

For example, let's say you have `compose-base.yaml`
and `compose.yaml`, where the former only has a
subset of the services but are both run as part of
the same named project.

Project based command:
```
docker compose -p myproj logs
```
This should return logs for active services based
on the project name, regardless of Compose file
state on disk.

File based command:
```
docker compose --file compose-base.yaml logs
```
This should return logs for ONLY services that are
defined in `compose-base.yaml`. Any other services
are considered 'orphaned' within the context of the
command and should be ignored.

See also #9705.

Fixes #9801.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-09-08 16:26:00 -04:00
..
build.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
completion.go Filter completions by toComplete variable 2021-07-12 14:33:37 -03:00
compose.go Apply newly loaded envvars to "DockerCli" and "APIClient" 2022-09-08 18:23:18 +02:00
compose_test.go move compose-plugin commands under /cmd 2021-06-15 15:52:48 +02:00
convert.go convert: do not escape $ into $$ when using the --no-interpolate option (#9703) 2022-09-08 16:25:23 -04:00
cp.go update usage of the index flag of the cp command 2022-05-10 10:50:40 +02:00
create.go don't apply default pull policy from command line if one is define in service configuration 2022-08-05 12:01:32 +02:00
down.go docs: remove extra whitespaces in help text (#9710) 2022-08-03 16:37:15 -04:00
events.go if command is ran with a compose file, apply the compose model, not just project name 2022-08-02 22:33:26 +02:00
exec.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
images.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
kill.go Apply compose model on `compose kill`, add `--remove-orphans` 2022-08-19 04:26:08 +02:00
list.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
logs.go logs: filter to services from current Compose file (#9811) 2022-09-08 16:26:00 -04:00
pause.go if command is ran with a compose file, apply the compose model, not just project name 2022-08-02 22:33:26 +02:00
port.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
ps.go Filter `compose ps` output by provided compose model 2022-08-02 22:33:26 +02:00
ps_test.go ps: use DisplayablePorts from docker/cli 2022-06-07 17:11:16 -05:00
pull.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
push.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
remove.go if command is ran with a compose file, apply the compose model, not just project name 2022-08-02 22:33:26 +02:00
restart.go if command is ran with a compose file, apply the compose model, not just project name 2022-08-02 22:33:26 +02:00
run.go docs: remove extra whitespaces in help text (#9710) 2022-08-03 16:37:15 -04:00
start.go Restrict compose project to selected services and dependencies on `compose start` 2022-09-08 12:31:55 -04:00
stop.go if command is ran with a compose file, apply the compose model, not just project name 2022-08-02 22:33:26 +02:00
top.go move compose-cli code into docker/compose/v2 2021-08-31 19:09:19 +02:00
tracing.go fix panic when using 'compose up --build' 2022-09-02 15:44:55 +02:00
up.go update usage strings for consistency 2022-08-02 13:32:29 +02:00
up_test.go get scale from deploy.replicas. Require scale normalization 2021-09-15 14:02:01 +02:00
version.go update usage strings for consistency 2022-08-02 13:32:29 +02:00