You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running terraform plan and/or terraform apply should not cause any updates.
Actual Behaviour
Service change is planned/performed every time.
Steps to Reproduce
terraform init
terraform apply -auto-approve
terraform plan or terraform apply
Important Factoids
According to docs, block bind_options is optional, and it has the only possible key which is also optional. (BTW there is copy-paste typo in docs, but I'll submit that as separate issue/PR).
But actually the behavior is shaky:
not supplying bind_options at all gives stable plan
supplying empty bind_options {} leads to a change every time
with bind_options { propagation = null } there is a change every time too
with bind_options { propagation = "rprivate" } (which is default value according to docs), there are no changes, the plan is stable
Not having empty bind_options {} might be tricky if configuration is generated (e.g. using TF module) since this is not a field like env = { ... } (could set it to null), and not a top-level resource block (could use conditional count = 0). Setting default value is also not an optimal solution as defaults might change over time, or they might be different for other platforms.
So, proposed solution would be treating empty bind_options {} block as if it was not specified at all. Maybe same should be done if it was specified as bind_options { propagation = null } too.
Update: I've mentioned a bug in docs, but apparently it is a bug in doc generator, and @mavogel is already aware and involved.
The text was updated successfully, but these errors were encountered:
Community Note
Terraform (and docker Provider) Version
Affected Resource(s)
docker_service
Terraform Configuration Files
Debug Output
Full output of
terraform plan
can be found here, and this is the part which demonstrates the problem:Expected Behaviour
Running
terraform plan
and/orterraform apply
should not cause any updates.Actual Behaviour
Service change is planned/performed every time.
Steps to Reproduce
terraform init
terraform apply -auto-approve
terraform plan
orterraform apply
Important Factoids
According to docs, block
bind_options
is optional, and it has the only possible key which is also optional. (BTW there is copy-paste typo in docs, but I'll submit that as separate issue/PR).But actually the behavior is shaky:
bind_options
at all gives stable planbind_options {}
leads to a change every timebind_options { propagation = null }
there is a change every time toobind_options { propagation = "rprivate" }
(which is default value according to docs), there are no changes, the plan is stableNot having empty
bind_options {}
might be tricky if configuration is generated (e.g. using TF module) since this is not a field likeenv = { ... }
(could set it to null), and not a top-level resource block (could use conditionalcount = 0
). Setting default value is also not an optimal solution as defaults might change over time, or they might be different for other platforms.So, proposed solution would be treating empty
bind_options {}
block as if it was not specified at all. Maybe same should be done if it was specified asbind_options { propagation = null }
too.Update: I've mentioned a bug in docs, but apparently it is a bug in doc generator, and @mavogel is already aware and involved.
The text was updated successfully, but these errors were encountered: