-
Notifications
You must be signed in to change notification settings - Fork 267
modules/tectonic/assets: ignore cluster_id regeneration #386
Conversation
Can one of the admins verify this patch? |
The documented suggestion to use the lifecycle/ignore_changes is correct. It's the preferred in such situations. It was also my first choice when originally trying to address this issue. Documentation exemplifies usage of lifecycle like this:
Unfortunately, in this particular setting, it's not applicable. The reason behind is that "cluster_id" is not a resource attribute, it's a member of the "vars" map value ("vars" is a resource attribute here). The problem is easily reproducible by doing an
We need another solution here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see @alexsomesan's comment
worst case: we should revert the change entirely back to just use |
@alexsomesan data sources do not have the lifecycle block, as they do not have any lifecycle at all (only the READ operation). And null resources do not let you specify any extra attribute anymore but triggers. |
Would loosening the expectation of a uuid on the TCO not be an option? |
Yeah, I tried the datasource approach in the mean time. No worky :/ |
There actually seems to be a troubled history with uuid(): |
I figured out a fix, but just found out that the interp function I am using is only avail in v0.9.2+.. |
Terraform 0.9.4 was just released with the ignition fix included. We are good to upgrade. Go ahead and PR the fix for 0.9.x |
Just submitted the idea for v0.8.8. Can be shortened a lot when using v0.9.2+ thanks to |
(v0.9.4 includes both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Before merging can you please build a cluster and confirm TCO is working properly with this change?
Otherwise LGTM
@alexsomesan Some background: IIRC the omaha server requires a uuid when reporting back to the server. And the uuid should map to the cluster so we can know which cluster is reporting back. |
This reverts commit 4aaeb73.
As documented, the ignore_changes lifecycle attribute must be used with uuid() in order to avoid regeneration of the resource at every plan/apply. Ref: https://terraform.io/docs/configuration/interpolation.html#uuid-
Tests are borked due to account quotas. Deployed cluster fine, TCO was running fine, and the UUID was stable across runs, therefore no additional assets.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good!
Let's get this in.
* Revert "Make cluster_id constant acrros applies for same cluster (coreos#225)" This reverts commit 4aaeb73. * modules/tectonic/assets: ignore cluster_id regeneration As documented, the ignore_changes lifecycle attribute must be used with uuid() in order to avoid regeneration of the resource at every plan/apply. Ref: https://terraform.io/docs/configuration/interpolation.html#uuid-
This PR reverts #225 as it breaks the Tectonic Channel Operator, which expects an uuid. We instead use the ignore_changes lifecycle attribute, as documented to achieve the same goal of avoiding the regeneration of the assets at every plan/apply executions.
/cc @alexsomesan