Skip to content
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

che-4061: change the key format for workspace find method #4115

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dockerfiles/base/scripts/base/commands/cmd_ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ help_cmd_ssh() {
text "\n"
text "Connect to a workspace in ${CHE_MINI_PRODUCT_NAME} over SSH\n"
text "\n"
text "WORKSPACE: Accepts workspace name, ID, or namespace:ws-name\n"
text "WORKSPACE: Accepts workspace ID or namespace/ws-name\n"
text " List all workspaces with 'action list-workspaces'\n"
text "\n"
text "MACHINE: Choose machine (default is dev machine) if workspace as multiple containers\n"
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/base/scripts/base/commands/cmd_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ help_cmd_sync() {
text "\n"
text "Synchronizes a ${CHE_MINI_PRODUCT_NAME} workspace to a local path mounted to ':/sync'\n"
text "\n"
text "WORKSPACE: Accepts workspace name, ID, or namespace:ws-name\n"
text "WORKSPACE: Accepts workspace ID or namespace/ws-name\n"
text " List all workspaces with 'action list-workspaces'\n"
text "\n"
text "PARAMETERS:\n"
Expand Down
7 changes: 0 additions & 7 deletions dockerfiles/lib/src/api/wsmaster/workspace/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ export class Workspace {
searchWorkspace(key:string):Promise<org.eclipse.che.api.workspace.shared.dto.WorkspaceDto> {
Log.getLogger().debug('search workspace with key', key);

// if workspace key is too short it's a workspace name
if (key && key.length < 21) {
if (key.indexOf(":") < 0) {
key = ":" + key;
}
}

var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, '/api/workspace/' + key, 200);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that by removing that part now we're unable to find a workspace by its name

return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => {
Log.getLogger().debug('got workspace with key', key, 'result: ', jsonResponse.getData());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {Ssh} from "../../../api/wsmaster/ssh/ssh";
*/
export class WorkspaceSshAction {

@Argument({description: "Defines the workspace to be used. use workspaceId, workspaceName or namespace:workspaceName as argument"})
@Argument({description: "Defines the workspace to be used. use workspaceId or namespace/workspaceName as argument"})
workspaceName : string;


Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/mount/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ Usage on Linux
-u \$(id -u \${USER})
-v <local-mount>/:/mnthost eclipse/che-mount <workspace-id|workspace-name>

<workspace-id|workspace-name> ID or Name of the workspace or namespace:workspace-name
<workspace-id|workspace-name> ID of the workspace or namespace/workspace-name

Usage on Mac or Windows:
docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse
--name che-mount
-v <path-to-sync-profile>:/profile
-v <local-mount>/:/mnthost eclipse/che-mount <workspace-id|workspace-name>

<workspace-id|workspace-name> ID or Name of the workspace or namespace:workspace-name
<workspace-id|workspace-name> ID of the workspace or namespace/workspace-name
"
UNISON_REPEAT_DELAY_IN_SEC=2
WORKSPACE_NAME=
Expand Down