Skip to content
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

storagezone: use d.Partial in Update instead of revertUpdateValues #2

Conversation

fho
Copy link

@fho fho commented Jun 16, 2022

The behavior described in #1 (comment) made me very suspicious because I did not encounter the behaviour before and other providers also do not revert the state after a failed update.

I turned out that this is an upstream bug: hashicorp/terraform-plugin-sdk#476

storagezone: use d.Partial in Update instead of revertUpdateValues

That after a failed update changes to the resource are still applied is a know
bug (https://github.com/hashicorp/terraform-plugin-sdk/issues/476).
It affects attributes that are not retrieved via the Get function and set only
by the provider.
custom_404_file_path is such a field.
As workaround d.Partial() can be called.
This is more simple then the revertUpdateValues() implementation.

-------------------------------------------------------------------------------
tests: add testcase that ensures failed update does not change current state

-------------------------------------------------------------------------------

fho added 2 commits June 16, 2022 09:55
That after a failed update changes to the resource are still applied is a know
bug (hashicorp/terraform-plugin-sdk#476).
It affects attributes that are not retrieved via the Get function and set only
by the provider.
custom_404_file_path is such a field.
As workaround d.Partial() can be called.
This is more simple then the revertUpdateValues() implementation.
@fho
Copy link
Author

fho commented Jun 16, 2022

@jspizziri fyi

@jspizziri
Copy link

@fho wow, nice find.

@jspizziri jspizziri merged commit 6677ca3 into 5-stones:feat/storage-zone Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants