-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 Terminated Workspace Panic #16692
Conversation
908fbdf
to
31e7d54
Compare
@@ -34,7 +34,7 @@ func WorkspaceState(conn *workspaces.WorkSpaces, workspaceID string) resource.St | |||
} | |||
|
|||
if len(output.Workspaces) == 0 { | |||
return nil, "", nil | |||
return output, workspaces.WorkspaceStateTerminated, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We consider an empty list in output as a real workspace termination sign. The workspaces.WorkspaceStateTerminated
state is checked right after the DescriobeWorkspaces
call in Read
func.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
3f52d54
to
ea0fde4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @Tensho 🚀
Output from acceptance testing:
--- PASS: TestFlattenWorkspaceProperties (0.00s)
--- PASS: TestExpandWorkspaceProperties (0.00s)
--- PASS: TestAccAwsWorkspacesWorkspace_validateRootVolumeSize (3.40s)
--- PASS: TestAccAwsWorkspacesWorkspace_validateUserVolumeSize (3.96s)
--- PASS: TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn (1775.72s)
--- PASS: TestAccAwsWorkspacesWorkspace_recreate (1836.44s)
--- PASS: TestAccAwsWorkspacesWorkspace_timeout (1848.37s)
--- PASS: TestAccAwsWorkspacesWorkspace_basic (1852.09s)
--- PASS: TestAccAwsWorkspacesWorkspace_tags (1876.63s)
--- PASS: TestAccAwsWorkspacesWorkspace_workspaceProperties (1899.23s)
This has been released in version 3.22.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #16654
Relates to #15945
Follow up to #15705
Release note for CHANGELOG:
Acceptance Test
Improvements