Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show an error on 'run' when there are legacy one-off containers #1643

Merged
merged 1 commit into from
Jul 8, 2015

Conversation

aanand
Copy link

@aanand aanand commented Jul 3, 2015

Also warn the user about the one-off containers in the standard error message about legacy containers.

Closes #1609.

@aanand aanand added this to the 1.3.1 milestone Jul 3, 2015
@aanand aanand modified the milestones: 1.3.1, 1.3.2 Jul 3, 2015
@aanand aanand force-pushed the warn-about-legacy-one-off-containers branch 3 times, most recently from 269743d to 02e228e Compare July 3, 2015 13:32
else:
legacy_containers.append(container)

return (legacy_containers, legacy_one_off_containers)
Copy link

Choose a reason for hiding this comment

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

I think this implementation could be a little simpler. Instead of always returning both, it could take a one_off=False kwarg (like a bunch of functions do currently).

If it's True return only the one_off containers, of it's False only the non-one_off containers.

That removes the need for the tuple return in check_name, validate_name, and this function.

I removes the unused return value from migrate_project_to_labels, and the logic in check_for_legacy_containers will be about the same.

Copy link

Choose a reason for hiding this comment

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

I guess the disadvantage there is the extra query for containers, which is relatively slow, but we're already adding one slow query to docker-compose run either way

Copy link
Author

Choose a reason for hiding this comment

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

Yeah - that was why I did it this way, but it does add a fair bit of complexity. As you say, I don't think it's worth the performance savings in the end. Will redo.

@aanand aanand force-pushed the warn-about-legacy-one-off-containers branch from 02e228e to 6b8c5a3 Compare July 6, 2015 13:43
Also warn the user about the one-off containers in the standard error
message about legacy containers.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
@aanand aanand force-pushed the warn-about-legacy-one-off-containers branch from 6b8c5a3 to e98caf5 Compare July 6, 2015 13:45
@aanand
Copy link
Author

aanand commented Jul 6, 2015

OK, I've made the code changes you suggested, and also changed the behaviour of docker-compose run so that it only does the check if it fails to create the container, so performance in the normal case isn't affected.

@dnephin
Copy link

dnephin commented Jul 8, 2015

LGTM

aanand added a commit that referenced this pull request Jul 8, 2015
…ners

Show an error on 'run' when there are legacy one-off containers
@aanand aanand merged commit 81707ef into docker:master Jul 8, 2015
@aanand aanand removed the in progress label Jul 8, 2015
@aanand aanand deleted the warn-about-legacy-one-off-containers branch July 8, 2015 13:48
aanand added a commit to aanand/fig that referenced this pull request Jul 14, 2015
…containers

Show an error on 'run' when there are legacy one-off containers
(cherry picked from commit 81707ef)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants