-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource/cloudflare_account: initialize AccountSettings #2034
Conversation
changelog detected ✅ |
thanks for this @jfchevrette. appreciate it! instead of unconditionally initialising the
|
@jacobbednarz, thank you for accepting this change! Much appreciated. However, with the changes you added atop of the original changeset, you won't ever be able to disable the 2-factor requirements via the Have a look at the following. I've added
2022-11-18T21:49:01.484+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout="(string) (len=7"
2022-11-18T21:49:01.484+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout=") "GetOk()""
2022-11-18T21:49:01.484+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout="(bool) true
(bool) true
(string) (len=13) "GetOkExists()"
(bool) true
(bool) true
(string) (len=10) "updatedAcc"
(cloudflare.Account) {
ID: (string) "",
Name: (string) (len=11) "kwilczynski",
Type: (string) "",
CreatedOn: (time.Time) 0001-01-01 00:00:00 +0000 UTC,
Settings: (*cloudflare.AccountSettings)(0xc000044c20)({
EnforceTwoFactor: (bool) true
})
}"
2022-11-18T23:08:03.778+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout=""GetOk()"
(bool) false
(bool) false
(string) (len=13) "GetOkExists()"
(bool) false
(bool) true
(string) (len=10) "updatedAcc"
(cloudflare.Account) {
ID: (string) "",
Name: (string) (len=11) "kwilczynski",
Type: (string) "",
CreatedOn: (time.Time)"
2022-11-18T23:08:03.778+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout="0001-01-01 00:00:00 +0000 UTC,"
2022-11-18T23:08:03.778+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout=Settings:
2022-11-18T23:08:03.778+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout=(*cloudflare.AccountSettings)(<nil>)
2022-11-18T23:08:03.778+0900 [WARN] unexpected data: registry.terraform.io/cloudflare/cloudflare:stdout=} Even though the logging in Terraform can be a bit unwieldy, can you see where the problem manifests itself? Update: To add more colour. The change @jfchevrette proposed fixed the problem and also made the other path - the disabling 2-factor authentication one - work, as the |
the zero value issue will need to be solved by updating the struct in cloudflare-go to be a boolean pointer. regardless of where the settings struct would have been initialised, we still would have had this issue due to zero values in Terraform, not only Go (this is something I've raised with the core team a couple of times). |
actually disregard; this is slightly different to the underlying issue at hashicorp/terraform-plugin-sdk#817. as the schema has you're welcome to send a PR removing the conditional or I can do it next week. |
Hi @jacobbednarz,
I am glad you raised this with them. I was worried that it would be a hill I, and many other people, would die on alone, so to speak. This has been an issue in Terraform for almost half a decade now.
You can do it at your convenience as long as it makes it into the next release. No rush otherwise. Also, thank you in advance for your help! Much appreciated. |
Hi @jacobbednarz,
This amazing. Thank you so much!
My pleasure! This is some amazing work you and your team are doing with this provider, so I am always happy to help as its user. :) |
This functionality has been released in v3.29.0 of the Terraform Cloudflare Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Attempt to fix a panic issue with uninitialized
account.Settings
inresourceCloudflareAccountUpdate
Fixes #2031