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

update error message regarding the option force_delete, which can be … #1274

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

uturunku1
Copy link
Collaborator

@uturunku1 uturunku1 commented Mar 4, 2024

…used also for the case when a workspace has no resources but the state version is still being processed

Description

The force-delete option is not only option for when a workspace has managed resources, but also when a workspaces has no resources but the state version is in the middle of being processed.

Slack conversation that can provide a bit more information about this: https://hashicorp.slack.com/archives/C01BR9FR8KZ/p1709331588604969

Related change: hashicorp/go-tfe#864

Remember to:

Testing plan

  1. Describe how to replicate
  2. the conditions
  3. under which your code performs its purpose,
  4. including example Terraform configs where necessary.

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTFEWorkspace" make testacc

...

@uturunku1 uturunku1 marked this pull request as ready for review March 4, 2024 17:22
@uturunku1 uturunku1 requested a review from a team as a code owner March 4, 2024 17:22
@uturunku1 uturunku1 requested a review from brandonc March 6, 2024 00:16
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Mention this change in the CHANGELOG

@@ -1005,7 +1005,7 @@ func resourceTFEWorkspaceImporter(ctx context.Context, d *schema.ResourceData, m
func errWorkspaceSafeDeleteWithPermission(workspaceID string, err error) error {
if err != nil {
if strings.HasPrefix(err.Error(), "conflict") {
return fmt.Errorf("error deleting workspace %s: %w\nTo delete this workspace without destroying the managed resources, add force_delete = true to the resource config", workspaceID, err)
return fmt.Errorf("error deleting workspace %s: %w\nTo delete this workspace, that either has managed resources or has a state version that still being processed, add force_delete = true to the resource config", workspaceID, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor grammar fix: or has a state version that is still being processed

…used also for the case when a workspace has no resources but the state version is still being processed
@uturunku1 uturunku1 merged commit 373e17d into main Mar 8, 2024
9 checks passed
@uturunku1 uturunku1 deleted the update-error-msg branch March 8, 2024 22:13
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

3 participants