-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Bug]: [hcloud_ssh_key] Error: Provider produced inconsistent result after apply #921
Comments
Hey @trombonax, thank you very much for reporting this issue! This was recently refactored in #855, #881 and #817 and we did not catch this with our test suite. The issue happens once you assign an empty map to labels: We are working on a fix and an extended test suite to make sure this does not get reintroduced. Until that is released you can fix your issue, but using |
When we implemented the Label helper we added some extra logic that handled the difference between the `label` attribute default (null) and the Hetzner Cloud API default (`{}`). This worked well in our test cases, but breaks if you pass an empty object to the attribute: When applying changes to hcloud_ssh_key.this, provider "provider[\"registry.terraform.io/hetznercloud/hcloud\"]" produced an unexpected new value: .labels: was cty.MapValEmpty(cty.String), but now null. We have now fixed this by setting the default of the labels field to an empty object to match the return value of the API. With this, we no longer need the workaround to handle null labels in Terraform config. Fixes #921
When we implemented the Label helper we added some extra logic that handled the difference between the `label` attribute default (null) and the Hetzner Cloud API default (`{}`). This worked well in our test cases, but breaks if you pass an empty object to the attribute: When applying changes to hcloud_ssh_key.this, provider "provider[\"registry.terraform.io/hetznercloud/hcloud\"]" produced an unexpected new value: .labels: was cty.MapValEmpty(cty.String), but now null. We have now fixed this by setting the default of the labels field to an empty object to match the return value of the API. With this, we no longer need the workaround to handle null labels in Terraform config. Fixes #921
When we implemented the Label helper we added some extra logic that handled the difference between the `label` attribute default (null) and the Hetzner Cloud API default (`{}`). This worked well in our test cases, but breaks if you pass an empty object to the attribute: ``` When applying changes to hcloud_ssh_key.this, provider "provider[\"registry.terraform.io/hetznercloud/hcloud\"]" produced an unexpected new value: .labels: was cty.MapValEmpty(cty.String), but now null. ``` We have now fixed this by setting the default of the labels field to an empty object to match the return value of the API. With this, we no longer need the workaround to handle null labels in Terraform config. Fixes #921
🤖 I have created a release *beep* *boop* --- ## [1.47.0](v1.46.1...v1.47.0) (2024-05-02) ### Features * test with Terraform 1.8 ([#919](#919)) ([800a66c](800a66c)) ### Bug Fixes * **ssh-key:** data inconsistency with empty label objects ([#922](#922)) ([7e1bf2c](7e1bf2c)), closes [#921](#921) * **subnet:** handle new error message for deleting subnets with attached resources ([#923](#923)) ([932c47b](932c47b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@apricote |
What happened?
opentofu-1.6.2
terraform-1.8.2
provider[registry.terraform.io/hetznercloud/hcloud] = 1.46.1
provider[registry.opentofu.org/hetznercloud/hcloud] = 1.46.1
What did you expect to happen?
simply ssh key add as resource via module
Please provide a minimal working example
module "hcloud-ssh-key":
module call from manifest:
The text was updated successfully, but these errors were encountered: