terraform-redhat / terraform-provider-rhcs

Terraform provider for Red Hat Cloud Services
Apache License 2.0
46 stars 77 forks source link

OCM-10640 | ci: Fix destroy resources if error in apply #764

Closed radtriste closed 2 weeks ago

radtriste commented 2 weeks ago

What this PR does / why we need it: In e2e tests, if an error occurs during apply, some resources may have been created already. But the TF vars file is not saved, thus the destroy will not occurs. This fix is storing the values in a tfvars tmp file and destroy will consider it if existing if the default TF vars file is not existing.

Which issue(s) this PR fixes https://issues.redhat.com/browse/OCM-10640

Change type

Checklist

radtriste commented 2 weeks ago

/hold

radtriste commented 2 weeks ago

VPC correctly deleted after Proxy failure: https://privatebin.corp.redhat.com/?6852e1ca9792bd09#9ogiRbEuKcpkcBUTNj22awjndfRyE8BD6DVLA7CYhriy

radtriste commented 2 weeks ago

/hold cancel

radtriste commented 2 weeks ago

/retest

xueli181114 commented 2 weeks ago

/lgtm

xueli181114 commented 2 weeks ago

/approve

openshift-ci[bot] commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xueli181114

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[tests/OWNERS](https://github.com/terraform-redhat/terraform-provider-rhcs/blob/main/tests/OWNERS)~~ [xueli181114] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment