Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Multiple fixes to container name detection #206
This PR fixes multiple issues with container names in the container provider; each of these issue has been encountered when playing with linked containers in #204. I have split each fix in a different changeset, feel free to cherry-pick (or merge everything if you like the PR).
Handle case when container has multiple names
Containers may have multiple names assigned to them; even if the user only assigns one name to the container, the use of features such as 'links' may append technical names to the container. The different names are displayed in the
When a container has multiple names, the
acc8296 should allow matching the container name with any of the different names of the container.
Made container matching more strict
When loading the current_resource, the docker_container provider iterates over each container listed in
As a consequence, chef tried to recreate the
My fix in cac59af is to stop considering that being run from the same image with the same cmdline is enough to 'match' a container. @bflad any side effects you imagine by being stricter? Matching an incorrect container is worse than matching none IMO.
Filter out technical names
When I was investigating #204, I found that the current_resource.container_name is initialized from the value of the raw NAMES colum in
In the case where
In 50b73cc I have decided to work around the issue by hiding the technical container names (such as