-
Notifications
You must be signed in to change notification settings - Fork 888
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just an edge case I'd like to see tested, and some potential speed-ups in creation.
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID) | ||
|
||
// Firstly, create a regular workspace using template with parameters. | ||
inv, root := clitest.New(t, "create", "my-workspace", "--template", template.Name, "-y", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: we now have dbfake.WorkspaceWithAgent if you want to speed things up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WorkspaceWithAgent
looks efficient, but I need a workspace with build parameters and a corresponding template with rich parameters. Not sure if the function supports it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢 🎺
May be we should call it We can put a disclaimer that it only copies the parameters and not the data stored in persisted resources. |
Fixes: #9923
This PR adds support for duplicating workspace using CLI. It is implemented as part of the
coder create
command according to this design (thanks @Parkreiner!).