- Notifications
You must be signed in to change notification settings - Fork928
Description
OS Information
- OS: macOS
- Browser (if applicable):
- Architecture:
coder --version
: Coder v0.6.0-devel+56ec53d0
Steps to Reproduce
- Create a workspace with persistent resources (e.g. docker example with volume)
coder show <name>
Expected
coder show
should list resources as permanent
Actual
% coder show test┌─────────────────────────────────────────────────────────────────┐│ RESOURCE STATUS ACCESS │├─────────────────────────────────────────────────────────────────┤│ docker_container.workspace ephemeral ││ └─ dev (linux, armv7) ⦾ connecting [7s] coder ssh test │├─────────────────────────────────────────────────────────────────┤│ docker_volume.home_volume ephemeral │└─────────────────────────────────────────────────────────────────┘
Logs
Screenshot
Notes
What's going on here is thatcoder show
is getting the resources for most recent build, which will only include resources at the most recent transition. Meanwhile, the CLI code derives the status of ephemeral / permanent based on whether there is a resource included for the stop transition. Since we only get start resources when querying the start job, the resources are always listed as ephemeral. You can see this clearly by stopping the workspace and then callingcoder show
again:
% coder show test┌───────────────────────────────────────────────┐│ RESOURCE STATUS ACCESS │├───────────────────────────────────────────────┤│ docker_volume.home_volume persistent │└───────────────────────────────────────────────┘
More generally, I'm not sure "status" is the right word for ephemeral vs permanent, as typically object status implies something that can change.
Finally, when we callcoder show
, I think users are going to be interested in not just whether the resourcewould remain if the workspace were stopped (ephemeral vs permanent), but whether the resourcepresently exists.
Implementation notes:
Options
- Get out of the idea of predicting ephemeral vs persistent. Coder show just shows you what the current resources are
- Fix the identification of ephemeral vs persistent based on the templates
- Really fix this by rerunning the dry tunes every time the parameters for the workspace are changed.
- have
--dryrun
option and do the computation at that time. This would have the impact of not being 'predictive' in terms of ephemeral vs persistent. (separate ticket / feature)
Decision: Option 1
AC
coder show does not show a status anymore - only the current resources
coder template create only shows the start resources
tests for the above