mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add enterprise external-workspaces CLI command (#19287)
This pull request introduces support for external workspace management, allowing users to register and manage workspaces that are provisioned and managed outside of the Coder. * coder external-workspaces create - Creates a new external workspace (this command extends coder create) * Example: coder external-workspaces create ext-workspace --template=externally-managed-workspace -y * Checks if template has coder_external_agent resource before creating a workspace * coder external-workspaces list - Lists all external workspaces * coder external-workspaces agent-instructions <workspace name> <agent name> - Retrieves agent connection instruction * Example: coder external-workspaces agent-instructions ext-workspace main --output=json
This commit is contained in:
+2
-2
@@ -72,7 +72,7 @@ func (r *RootCmd) openVSCode() *serpent.Command {
|
||||
// need to wait for the agent to start.
|
||||
workspaceQuery := inv.Args[0]
|
||||
autostart := true
|
||||
workspace, workspaceAgent, otherWorkspaceAgents, err := getWorkspaceAndAgent(ctx, inv, client, autostart, workspaceQuery)
|
||||
workspace, workspaceAgent, otherWorkspaceAgents, err := GetWorkspaceAndAgent(ctx, inv, client, autostart, workspaceQuery)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("get workspace and agent: %w", err)
|
||||
}
|
||||
@@ -316,7 +316,7 @@ func (r *RootCmd) openApp() *serpent.Command {
|
||||
}
|
||||
|
||||
workspaceName := inv.Args[0]
|
||||
ws, agt, _, err := getWorkspaceAndAgent(ctx, inv, client, false, workspaceName)
|
||||
ws, agt, _, err := GetWorkspaceAndAgent(ctx, inv, client, false, workspaceName)
|
||||
if err != nil {
|
||||
var sdkErr *codersdk.Error
|
||||
if errors.As(err, &sdkErr) && sdkErr.StatusCode() == http.StatusNotFound {
|
||||
|
||||
Reference in New Issue
Block a user