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

CLI:coder create does not check/sanitize workspace name before creating #14544

Closed
@phorcys420

Description

@phorcys420

Discord thread


coder create checks for the name after running theterraform plan, which is fine in most cases even though it makes you lose some time.

Here is what would usually happen to an user :

output ofcoder create phorcys420/invalid_name -t aws-linux (on dogfood)
PS C:\Users\Phorcys\Documents> coder create phorcys420/invalid_name -t aws-linuxAWS Region  The region to deploy workspace infrastructure.?  EU (Paris)> EU (Paris)Instance type  What instance type should your workspace use??  2 vCPU, 1 GiB RAM> 2 vCPU, 1 GiB RAMPlanning workspace...=== ✔ Queued [0ms]==> ⧗ Running==> ⧗ Running=== ✔ Running [13ms]==> ⧗ Setting up=== ✔ Setting up [69ms]==> ⧗ Detecting persistent resources=== ✔ Detecting persistent resources [15661ms]==> ⧗ Cleaning Up=== ✔ Cleaning Up [39ms]┌──────────────────────────────────────────────────────────┐│ Workspace Preview                                        │├──────────────────────────────────────────────────────────┤│ RESOURCE                    ACCESS                       │├──────────────────────────────────────────────────────────┤│ aws_ec2_instance_state.dev                               │├──────────────────────────────────────────────────────────┤│ aws_instance.dev                                         ││ └─ dev (linux, amd64)        coder ssh invalid_name      │└──────────────────────────────────────────────────────────┘> Confirm create? (yes/no) yesEncountered an error running "coder create", see "coder create --help" for more informationerror: Trace=[create workspace: ]Validation failed.1 validation error(s) found         name : Validation failed for tag "workspace_name" with value: "invalid_name"

But in some cases, it will even make the plan fail if the workspace name causes an error in the template, such as with_ in k8s.
Which makes it so that it doesn't even show the validation error because the plan exits before the validation.

output ofcoder create commands with thesample Kubernetes template (on my testing instance)
PS C:\Users\Phorcys> coder create admin/workshop_ia -t kubernetes-titimobyversion mismatch: client v2.11.2+d53c94b, server v2.10.2+a11b169download the server version from: https://github.com/coder/coder/releases/v2.10.2Planning workspace...=== ✔ Queued [70ms]==> ⧗ Running==> ⧗ Running=== ✔ Running [36ms]==> ⧗ Setting up=== ✔ Setting up [114ms]==> ⧗ Detecting persistent resources=== ✔ Detecting persistent resources [6134ms]==> ⧗ Cleaning Up=== ✘ Cleaning Up [12ms]=== ✘ Cleaning Up [31ms]Encountered an error running "coder create", see "coder create --help" for more informationerror: prepare build: dry-run workspace: run dry-run provision job: terraform plan: exit status 1PS C:\Users\Phorcys> coder create admin/workshop-ia -t kubernetes-titimobyversion mismatch: client v2.11.2+d53c94b, server v2.10.2+a11b169download the server version from: https://github.com/coder/coder/releases/v2.10.2Planning workspace...=== ✔ Queued [64ms]==> ⧗ Running==> ⧗ Running=== ✔ Running [12ms]==> ⧗ Setting up=== ✔ Setting up [106ms]==> ⧗ Detecting persistent resources=== ✔ Detecting persistent resources [7152ms]==> ⧗ Cleaning Up=== ✔ Cleaning Up [93ms]┌──────────────────────────────────────────────────────────────────────┐│ Workspace Preview                                                    │├──────────────────────────────────────────────────────────────────────┤│ RESOURCE                                 ACCESS                      │├──────────────────────────────────────────────────────────────────────┤│ kubernetes_deployment.main                                           ││ └─ main (linux, amd64)                    coder ssh workshop-ia      │├──────────────────────────────────────────────────────────────────────┤│ kubernetes_persistent_volume_claim.home                              │└──────────────────────────────────────────────────────────────────────┘

This should be a relatively low-effort change in my opinion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp