Skip to content

Conversation

@aanand
Copy link

@aanand aanand commented Aug 12, 2015

When running docker-compose up A B, logs are shown for those services and all their dependencies, which is not what the user expects. This regressed in #1645.

Not wild about the variable names here - would appreciate a second pair of eyes.

Closes #1856.

When running `docker-compose up A B`, logs are shown for those services
*and all their dependencies*, which is not what the user expects. This
regressed in bd554a6.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
if service in services:
containers_to_return += containers

return containers_to_return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this. I think project.up() should still return all the containers it created.

I would think the filtering should happen in the cli.main.up() (or it can call a function to do the filtering) since that's the layer that deals with user expectations.

I think it's conceivable that something else might want to know all the containers created by up (I say this because I've actually written code that has that expectation).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough - only problem with doing it in cli.main.up is that it can't be tested.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(easily)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, that's true. At some point I think it might make sense to split up some of the larger cli functions into some smaller functions (to make it easier to test), but that doesn't need to happen now.

In this case I think everything that happens after project.up() could be in a separate function:

if detached:
    return

print_logs_for_up(containers, service_names, monochrome, timeout)

@dnephin
Copy link

dnephin commented Aug 27, 2015

Closed by #1931

@dnephin dnephin closed this Aug 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants