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

Fix incorrect state update following NSX error #1138

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Fix incorrect state update following NSX error #1138

merged 1 commit into from
Mar 5, 2024

Conversation

annakhm
Copy link
Collaborator

@annakhm annakhm commented Mar 5, 2024

When QoS profile resource is updated with incorrect value that NSX rejects, the value would still get updated in the state, even though Update returned an error.
This is terraform SDK bug:
hashicorp/terraform-plugin-sdk#476

This change implements the suggested workaround.

We should consider to always implement this workaround as part of handleUpdateError, however first it would help to understand why this problem appears only for certain resources.

When QoS profile resource is updated with incorrect value that
NSX rejects, the value would still get updated in the state, even
though Update returned an error.
This is terraform SDK bug:
hashicorp/terraform-provider-nomad#385

This change implements the suggested workaround.

Signed-off-by: Anna Khmelnitsky <akhmelnitsky@vmware.com>
@ksamoray
Copy link
Collaborator

ksamoray commented Mar 5, 2024

@annakhm should we apply this on other resources with the update issue?

@annakhm
Copy link
Collaborator Author

annakhm commented Mar 5, 2024

@annakhm should we apply this on other resources with the update issue?

We can only apply this when Update function of the provider gets executed (it seems). When attribute validation fails the provider has no say and can't squeeze this in..

@annakhm
Copy link
Collaborator Author

annakhm commented Mar 5, 2024

/test-all

@annakhm annakhm merged commit 1ce16df into master Mar 5, 2024
7 checks passed
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.

None yet

2 participants