Skip to content

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

Merged
deansheather merged 2 commits into
mainfrom
allow-delete-no-state
May 20, 2022
Merged

deansheather merged 2 commits into
mainfrom
allow-delete-no-state

Conversation

@deansheather

Copy link
Copy Markdown
Collaborator

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
Comment thread provisioner/terraform/provision.go Resolved
Comment thread provisioner/terraform/provision.go Resolved
Comment thread provisioner/terraform/provision.go Outdated
}
}()

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

Copy link
Copy Markdown
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