Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: skip terraform destroy if there is no state when deleting #1594

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

Merged
merged 2 commits into from
May 20, 2022

Conversation

deansheather
Copy link
Member

If a workspace is being deleted and has no state (which could be caused by a failed create, maybe because the params didn't pass validation for example), then this skips calling terraform apply -destroy.

This alleviates some of the pain in #831 by allowing these broken workspaces to be deleted successfully. Future work will be done to mitigate broken workspaces in the first place.

Example with a workspace that is broken due to broken validation on params:

image

@deansheather deansheather requested a review from AbhineetJain May 19, 2022 16:57
@@ -190,6 +198,41 @@ func (t *terraform) Provision(stream proto.DRPCProvisioner_ProvisionStream) erro
}
}()

// If we're destroying, exit early if there's no state.
Copy link
Member

Choose a reason for hiding this comment

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

It'd be helpful to elaborate here and explain the user-story of why we need this. It's an edge-case, and doesn't seem like suuuuper expected behavior.

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.

3 participants