Skip to content

Commit 36cbcfa

Browse files
committed
SSH notice: unsupported workspace
1 parent 796a3b9 commit 36cbcfa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

cli/ssh.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,23 @@ func (r *RootCmd) ssh() *clibase.Cmd {
105105
return err
106106
}
107107

108+
templateVersion, err := client.TemplateVersion(ctx, workspace.LatestBuild.TemplateVersionID)
109+
if err != nil {
110+
return err
111+
}
112+
113+
var unsupportedWorkspace bool
114+
for _, warning := range templateVersion.Warnings {
115+
if warning == codersdk.TemplateVersionWarningUnsupportedWorkspaces {
116+
unsupportedWorkspace = true
117+
break
118+
}
119+
}
120+
121+
if unsupportedWorkspace && isTTYErr(inv) {
122+
_, _ = fmt.Fprintln(inv.Stderr, "👋 Your workspace uses legacy parameters which are not supported anymore. Please delete the workspace and use a different template.")
123+
}
124+
108125
updateWorkspaceBanner, outdated := verifyWorkspaceOutdated(client, workspace)
109126
if outdated && isTTYErr(inv) {
110127
_, _ = fmt.Fprintln(inv.Stderr, updateWorkspaceBanner)

0 commit comments

Comments
 (0)