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 read of vcd_vapp_vm resource when VM it isn't found. Allows terraform to recreate resource and not fail #783

Merged
merged 8 commits into from
Feb 22, 2022

Conversation

vbauzys
Copy link
Contributor

@vbauzys vbauzys commented Feb 8, 2022

Ref: #611

…e resource when it isn't found

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
@vbauzys vbauzys changed the title Fix read of VM resource when it isn't found. Allows terraform to recreate resource and not fail Fix read of VM resource when VM it isn't found. Allows terraform to recreate resource and not fail Feb 8, 2022
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
@vbauzys vbauzys changed the title Fix read of VM resource when VM it isn't found. Allows terraform to recreate resource and not fail Fix read of vcd_vapp_vm resource when VM it isn't found. Allows terraform to recreate resource and not fail Feb 8, 2022
@vbauzys vbauzys marked this pull request as ready for review February 8, 2022 15:26
@vbauzys vbauzys self-assigned this Feb 8, 2022
@vbauzys vbauzys requested review from adambarreiro and mikeletux and removed request for dataclouder February 8, 2022 15:26
@@ -0,0 +1 @@
* Fix Issue #611 when read of `vcd_vapp_vm` resource failed when vm isn't found. Now allows terraform to recreate resource when it isn't found. [GH-783]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bit of nitpicking 😄

Suggested change
* Fix Issue #611 when read of `vcd_vapp_vm` resource failed when vm isn't found. Now allows terraform to recreate resource when it isn't found. [GH-783]
* Fix Issue #611 when read of `vcd_vapp_vm` resource failed when VM isn't found. Now allows Terraform to recreate resource when it isn't found. [GH-783]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, updated

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding a test for this use case?

@vbauzys vbauzys closed this Feb 14, 2022
@vbauzys vbauzys reopened this Feb 14, 2022
@vbauzys
Copy link
Contributor Author

vbauzys commented Feb 14, 2022

What about adding a test for this use case?

Not sure it's possible to check the result of this failure in the test, will check.

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
@vbauzys
Copy link
Contributor Author

vbauzys commented Feb 15, 2022

What about adding a test for this use case?

Not sure it's possible to check the result of this failure in the test, will check.

added

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic :) Tried on both vcd_vapp_vm and vcd_vm - works great.

@@ -0,0 +1 @@
* Fix Issue #611 when read of `vcd_vapp_vm` resource failed when VM isn't found. Now allows Terraform to recreate resource when it isn't found. [GH-783]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Fix Issue #611 when read of `vcd_vapp_vm` resource failed when VM isn't found. Now allows Terraform to recreate resource when it isn't found. [GH-783]
* Fix Issue #611 when read of `vcd_vapp_vm` and `vcd_vm` resource failed when VM isn't found. Now allows Terraform to recreate resource when it isn't found. [GH-783]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Contributor

@mikeletux mikeletux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run both vcd_vapp_vm and vcd_vm.
When applying it for the second time when previously deleted manually the vm, it recreates it.

Thanks for the effort @vbauzysvmware

@Didainius Didainius mentioned this pull request Nov 4, 2022
12 tasks
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.

5 participants