You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "ianc769 (via GitHub)" <gi...@apache.org> on 2026/01/06 16:14:18 UTC

[PR] Fix infinite update loop for optional zone fields [cloudstack-terraform-provider]

ianc769 opened a new pull request, #272:
URL: https://github.com/apache/cloudstack-terraform-provider/pull/272

   Add `Computed: true` to optional zone fields that are set by the Read function. This prevents Terraform from detecting false drift when these fields are not explicitly set in the configuration but have values returned by the CloudStack API.
   
   Fields fixed:
   - `guest_cidr_address`
   - `dns2`
   - `internal_dns2`
   - `ip6_dns1`
   - `ip6_dns2`
   
   The issue occurred because these fields were Optional but not Computed. When a user removed a previously set value from their config, Terraform would:
   1. Expect the field to be null (not in config)
   2. Read a non-null value from the API
   3. Detect drift and plan to remove it
   4. Send an update with the field omitted
   5. CloudStack would retain the old value (no explicit clear)
   6. Loop back to step 2
   
   With Optional + Computed, Terraform accepts API-provided values even when not explicitly set in the configuration, breaking the update loop.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix infinite update loop for optional zone fields [cloudstack-terraform-provider]

Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti merged PR #272:
URL: https://github.com/apache/cloudstack-terraform-provider/pull/272


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org