Open inercia opened 5 years ago
Reproduced Terraform v0.13.0 :
Was there some intention or reason having rm=true
flag being set to result in setting an empty string on the ID, and returning nil, without stopping the container?
Ref: https://github.com/terraform-providers/terraform-provider-docker/blob/master/docker/resource_docker_container_funcs.go#L750
This option seems to be introduced by #43 and #106 .
I guess originally this option was introduced for the short-lived
container,
which runs a command and is destoyed everytime terraform apply
is run.
I think the description of this option is insufficient.
https://www.terraform.io/docs/providers/docker/r/container.html#rm
rm - (Optional, bool) If true, then the container will be automatically removed after his execution. Terraform won't check this container after creation.
Terraform Version
Terraform v0.11.15-dev
Affected Resource(s)
Terraform Configuration Files
Debug Output
cluster creation cluster destruction
Expected Behavior
The docker container should have been properly stopped, but it is still running after
terraform destroy
. Adocker ps
shows the container running.Actual Behavior
From the docs "If true, then the container will be automatically removed after his execution. Terraform won't check this container after creation.", so it seems to be equivalent to the
--rm
flag ofdocker
. However, the docker container is not stopped at all (let alone to be removed). Maybe therm
argument is not preoperly explained in the docs.Looking at the code, it seems the only thing the provider does when destroying the container with
rm=true
is to remove the ID.Steps to Reproduce
rm=true
in a container.terraform apply
terraform destroy