logs: filter to services from current Compose file #9811
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
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
andcompose.yaml
, where the former only has asubset of the services but are both run as part of the same named project.
Project based command:
This should return logs for active services based
on the project name, regardless of Compose file
state on disk.
File based command:
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.Related issue
See also #9705.
Fixes #9801.
(not mandatory) A picture of a cute animal, if possible in relation with what you did