Open Temikus opened 5 years ago
Yes, we need to revisit this in #138 which will probably be a BC. Sorry but the feature of #103 causes too much trouble. It is very likely a bug in the plugin-sdk: https://github.com/hashicorp/terraform-plugin-sdk/issues/195
@mavogel Thanks for the quick response!
Just to check, what does ‘BC’ mean in your context?
Sorry for the abbreviations: BC -> Breaking Change
I'm struggling with this on my running containers, it forces me to re-create the container for each terraform run. It also wants to replace my volumes as well.
Terraform v0.12.19
I just started learning Terraform yesterday and my instructor uses v 0.11 but I am using 0.12. The first bulk of lessons focus on docker, and with each $ terraform apply (even without any change to my *.tf file) the container is replaced with a new one although the previous container was working fine. In my opinion this kills the concept of idempotency in infrastructure as code.
Versions: Terraform v0.12.24
You're right @etattw it is currently a bug in v2.7.0
and not intended to replace to container each time although the tf
did not change. See #242
Looks like this may be a reoccurrence of https://github.com/hashicorp/terraform/issues/19294
Starting with a recent upgrade of the provider (sadly I do not remember which one I've upgraded from) docker provider started forcing recreation of containers that have ports published.
Repro:
1) Fire up this example container:
2)
terraform apply
3) ssh onto the host 4)docker kill btsync
5)terraform plan
EXPECTED BEHAVIOUR:must_run
is set to false ACTUAL BEHAVIOUR:Note that this doesn't happen with another container that's also stopped but doesn't have ports defined, here's the example config: