-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
docker provider tries to recreate running containers with swarm #1979
Comments
👍 |
It appears that when a container is getting created through the swarm api, the .tfstate file is not getting filled out with all of the data.
This comes from a run where I create a docker_image and a docker_container. The container does run on the remote docker system, but it is not populated in the tfstate file. The image appears to work however. |
I've narrowed the problem down to resourceDockerContainerRead in resource_docker_container_funcs.go. The issue appears to be that swarm appends the hostname the container is run on in front of the specified name. So in the example I pasted above, 'genepool' is referenced by Swarm as 'hostname/genepool' When the code below executes, it tries to find 'genepool' through the Swarm API and fails. SetId is set to "" and the function returns.
Looking into a fix in 'fetchDockerContainer' |
I have created a pull request that fixes this issue. #1990 |
This was fixed in #4148 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
setup a swarm cluster ( I used https://github.com/shokunin/puppet-docker-swarm )
run terraform apply and the container gets created properly and is running
run terraform apply again and it says the resource has already been created
Looking at a tcpdump of the second call to terraform apply I see the following traffic where the images are listed, but nothing ever checks to see if any container with that name is running before attempting to create it again
The text was updated successfully, but these errors were encountered: