Skip to content

Commit d3b3479

Browse files
committed
convert ide config
1 parent 0c10538 commit d3b3479

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

components/public-api-server/pkg/apiv1/workspace.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,29 @@ func convertWorkspaceInfo(input *protocol.WorkspaceInfo) (*v1.Workspace, error)
427427
},
428428
}},
429429
},
430+
Editor: convertIdeConfig(input.LatestInstance.Configuration.IDEConfig),
430431
Description: input.Workspace.Description,
431432
Status: &v1.WorkspaceStatus{
432433
Instance: instance,
433434
},
434435
}, nil
435436
}
436437

438+
func convertIdeConfig(ideConfig *protocol.WorkspaceInstanceIDEConfig) *v1.EditorReference {
439+
if ideConfig == nil {
440+
return nil
441+
}
442+
ideVersion := "stable"
443+
if ideConfig.UseLatest {
444+
ideVersion = "stable"
445+
}
446+
return &v1.EditorReference{
447+
Name: ideConfig.IDE,
448+
Version: ideVersion,
449+
PreferToolbox: ideConfig.PreferToolbox,
450+
}
451+
}
452+
437453
func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.WorkspaceContext, config *protocol.WorkspaceConfig, shareable bool) (*v1.WorkspaceInstance, error) {
438454
if wsi == nil {
439455
return nil, nil

0 commit comments

Comments
 (0)