-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Improve remove docker container function to take into account stopped containers #12979
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch and thanks for jumping on this! Once there is a test for this, we should be good to go! 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: This module is incredibly important and well-tested, and we basically try to have tests for every change whenever possible. Could you please add a test for this edge case to the test for this module?
The tests are done in this class here:
class TestDockerClient: |
When adding a new test, it will automatically be executed for both - the SDK and the CMD client. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I agree with Alex on the tests, would be nice to get one!
Motivation
Right now, this remove container method doesn't take into account stopped containers when you ask it to check for existence of it
Related PR for more context about why bother with this change -> https://github.com/localstack/localstack-pro/pull/5037
Changes
get_all_container_names
) I didn't touch the old method (get_running_container_names
) to keep compatibility and not break any code already using it.