Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

coder show incorrectly shows permanent resources as ephemeral. #1937

Closed
Assignees
spikecurtis
Labels
apiArea: HTTP APIcliArea: CLI
@spikecurtis

Description

@spikecurtis

OS Information

  • OS: macOS
  • Browser (if applicable):
  • Architecture:
  • coder --version: Coder v0.6.0-devel+56ec53d0

Steps to Reproduce

  1. Create a workspace with persistent resources (e.g. docker example with volume)
  2. 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

  1. Get out of the idea of predicting ephemeral vs persistent. Coder show just shows you what the current resources are
  2. Fix the identification of ephemeral vs persistent based on the templates
  3. Really fix this by rerunning the dry tunes every time the parameters for the workspace are changed.
  4. 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

Metadata

Metadata

Assignees

Labels

apiArea: HTTP APIcliArea: CLI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp