Skip to content

feat(cli): create workspace using parameters from existing workspace #10604

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 10 commits into from
Nov 9, 2023
Merged
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
Next Next commit
Improve
  • Loading branch information
mtojek committed Nov 9, 2023
commit f0bb47ecdb1e8f9d0df66620ea435a21a4ea9100
6 changes: 3 additions & 3 deletions cli/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (r *RootCmd) create() *clibase.Cmd {

sourceWorkspace, err = client.WorkspaceByOwnerAndName(inv.Context(), sourceWorkspaceOwner, sourceWorkspaceName, codersdk.WorkspaceOptions{})
if err != nil {
return err
return xerrors.Errorf("get source workspace: %w", err)
}

_, _ = fmt.Fprintf(inv.Stdout, "Coder will use the same template %q as the source workspace.\n", sourceWorkspace.TemplateName)
Expand Down Expand Up @@ -158,9 +158,9 @@ func (r *RootCmd) create() *clibase.Cmd {

var sourceWorkspaceParameters []codersdk.WorkspaceBuildParameter
if copyParameters != "" {
sourceWorkspaceParameters, err = client.WorkspaceBuildParameters(inv.Context(), sourceWorkspace.ID)
sourceWorkspaceParameters, err = client.WorkspaceBuildParameters(inv.Context(), sourceWorkspace.LatestBuild.ID)
if err != nil {
return err
return xerrors.Errorf("get source workspace build parameters: %w", err)
}
}

Expand Down