diff --git a/packages/code-server/code-server-lib/src/main/java/com/daimler/data/service/workspace/BaseWorkspaceService.java b/packages/code-server/code-server-lib/src/main/java/com/daimler/data/service/workspace/BaseWorkspaceService.java index a09d716599..7c30348724 100644 --- a/packages/code-server/code-server-lib/src/main/java/com/daimler/data/service/workspace/BaseWorkspaceService.java +++ b/packages/code-server/code-server-lib/src/main/java/com/daimler/data/service/workspace/BaseWorkspaceService.java @@ -135,6 +135,7 @@ public class BaseWorkspaceService implements WorkspaceService { @Value("${codeServer.collab.pid}") private String collabPid; + @Value("${codeServer.codespace.filename}") private String codespaceFileName; @@ -740,6 +741,7 @@ public InitializeWorkspaceResponseVO initiateWorkspace(CodeServerWorkspaceVO vo, String[] parts = resource.split(","); ownerWorkbenchCreateInputsDto.setStorage_capacity(parts[0]); ownerWorkbenchCreateInputsDto.setMem_guarantee(parts[1]); + ownerWorkbenchCreateInputsDto.setCloudServiceProvider(ConstantsUtility.DHC_CAAS_AWS); ownerWorkbenchCreateInputsDto.setMem_limit(parts[3]); double cpuLimit = Double.parseDouble(parts[4].replaceAll("[^0-9.]", "")); double cpuGuarantee = Double.parseDouble(parts[2].replaceAll("[^0-9.]", "")); @@ -750,11 +752,8 @@ public InitializeWorkspaceResponseVO initiateWorkspace(CodeServerWorkspaceVO vo, } else { ownerWorkbenchCreateInputsDto.setProfile("default"); } - if(entity.getData().getProjectDetails().getRecipeDetails().getCloudServiceProvider().equals(CloudServiceProviderEnum.CAAS.name())){ - ownerWorkbenchCreateInputsDto.setEnvironment(codeServerEnvValue); - } else { - ownerWorkbenchCreateInputsDto.setEnvironment(codeServerEnvValueAws); - } + + ownerWorkbenchCreateInputsDto.setEnvironment(codeServerEnvValueAws); ownerWorkbenchCreateInputsDto.setPathCheckout(pathCheckout); if(Objects.nonNull(projectOwner) && Objects.nonNull(workspaceOwner) && projectOwner.getId().equalsIgnoreCase(workspaceOwner.getId())) { ownerWorkbenchCreateInputsDto.setIsCollaborator("false"); @@ -811,12 +810,13 @@ public InitializeWorkspaceResponseVO initiateWorkspace(CodeServerWorkspaceVO vo, } } Date initatedOn = new Date(); + SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+00:00"); entity.getData().setIntiatedOn(isoFormat.parse(isoFormat.format(new Date()))); // entity.getData().setStatus(ConstantsUtility.CREATEREQUESTEDSTATE); entity.getData().setStatus(ConstantsUtility.CREATEDSTATE);//added String recipeId = vo.getProjectDetails().getRecipeDetails().getRecipeId().toString(); - String workspaceUrl = this.getWorkspaceUrl(recipeId,ownerwsid,workspaceOwner.getId(),vo.getProjectDetails().getRecipeDetails().getCloudServiceProvider().name()); + String workspaceUrl = this.getWorkspaceUrl(recipeId,ownerwsid,workspaceOwner.getId(),ConstantsUtility.DHC_CAAS_AWS); entity.getData().setWorkspaceUrl(workspaceUrl); jpaRepo.save(entity); responseVO.setData(workspaceAssembler.toVo(entity));