8000 feat: support fully-qualified workspace names in CLI by dwahler · Pull Request #2036 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: support fully-qualified workspace names in CLI #2036

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

Merged
merged 4 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
improve error message for invalid workspace name
    8000
  • Loading branch information
dwahler committed Jun 3, 2022
commit 530a4b0d2785014b1ae375f2d8b5b5437b1e9220
2 changes: 1 addition & 1 deletion cli/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestDelete(t *testing.T) {
go func() {
defer close(doneChan)
err := cmd.Execute()
assert.ErrorContains(t, err, "invalid workspace name")
assert.ErrorContains(t, err, "invalid workspace name: \"a/b/c\"")
}()
<-doneChan
})
Expand Down
2 changes: 1 addition & 1 deletion cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func namedWorkspace(cmd *cobra.Command, client *codersdk.Client, orgID uuid.UUID
owner = parts[0]
name = parts[1]
default:
return codersdk.Workspace{}, xerrors.New("invalid workspace name")
return codersdk.Workspace{}, xerrors.Errorf("invalid workspace name: %q", identifier)
}

return client.WorkspaceByOwnerAndName(cmd.Context(), orgID, owner, name)
Expand Down
0