Verify if the user workspace is outdated and prepare an actionable message for user.
(client *codersdk.Client, workspace codersdk.Workspace)
| 1189 | |
| 1190 | // Verify if the user workspace is outdated and prepare an actionable message for user. |
| 1191 | func verifyWorkspaceOutdated(client *codersdk.Client, workspace codersdk.Workspace) (string, bool) { |
| 1192 | if !workspace.Outdated { |
| 1193 | return "", false // workspace is up-to-date |
| 1194 | } |
| 1195 | |
| 1196 | workspaceLink := buildWorkspaceLink(client.URL, workspace) |
| 1197 | return fmt.Sprintf("👋 Your workspace is outdated! Update it here: %s\n", workspaceLink), true |
| 1198 | } |
| 1199 | |
| 1200 | // Build the user workspace link which navigates to the Coder web UI. |
| 1201 | func buildWorkspaceLink(serverURL *url.URL, workspace codersdk.Workspace) *url.URL { |