Skip to content

Commit a7e8f98

Browse files
authored
feat: Unhide workspace rename command (coder#5464)
1 parent e3cf759 commit a7e8f98

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

cli/rename.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ func rename() *cobra.Command {
1616
Use: "rename <workspace> <new name>",
1717
Short: "Rename a workspace",
1818
Args: cobra.ExactArgs(2),
19-
// Keep hidden until renaming is safe, see:
20-
// * https://github.com/coder/coder/issues/3000
21-
// * https://github.com/coder/coder/issues/3386
22-
Hidden: true,
2319
RunE: func(cmd *cobra.Command, args []string) error {
2420
client, err := CreateClient(cmd)
2521
if err != nil {
@@ -31,8 +27,9 @@ func rename() *cobra.Command {
3127
}
3228

3329
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n",
34-
cliui.Styles.Wrap.Render("WARNING: A rename can result in data loss if a resource references the workspace name in the template (e.g volumes)."),
30+
cliui.Styles.Wrap.Render("WARNING: A rename can result in data loss if a resource references the workspace name in the template (e.g volumes). Please backup any data before proceeding."),
3531
)
32+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "See: %s\n\n", "https://coder.com/docs/coder-oss/latest/templates/resource-persistence#%EF%B8%8F-persistence-pitfalls")
3633
_, err = cliui.Prompt(cmd, cliui.PromptOptions{
3734
Text: fmt.Sprintf("Type %q to confirm rename:", workspace.Name),
3835
Validate: func(s string) error {

cli/testdata/coder_--help.golden

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Workspace Commands:
3636
create Create a workspace
3737
delete Delete a workspace
3838
list List workspaces
39+
rename Rename a workspace
3940
schedule Schedule automated start and stop times for workspaces
4041
show Display details of a workspace's resources and agents
4142
speedtest Run upload and download tests from your machine to a workspace

0 commit comments

Comments
 (0)