diff --git a/dashboard/src/app/get-started/template-list/template-list.controller.ts b/dashboard/src/app/get-started/template-list/template-list.controller.ts index cf7e1249ea3..960934fab6d 100644 --- a/dashboard/src/app/get-started/template-list/template-list.controller.ts +++ b/dashboard/src/app/get-started/template-list/template-list.controller.ts @@ -37,6 +37,8 @@ export class TemplateListController { '$log', 'cheNotification']; + ephemeralMode: boolean; + private $q: ng.IQService; private $log: ng.ILogService; private $filter: ng.IFilterService; @@ -104,6 +106,7 @@ export class TemplateListController { cheWorkspace.fetchWorkspaceSettings().then(() => { const workspaceSettings = cheWorkspace.getWorkspaceSettings(); this.devfileRegistryUrl = workspaceSettings && workspaceSettings.cheWorkspaceDevfileRegistryUrl; + this.ephemeralMode = workspaceSettings['che.workspace.persist_volumes.default'] === 'false'; this.init(); }); } @@ -140,6 +143,12 @@ export class TemplateListController { const selfLink = this.selectedDevfile.links.self; return this.devfileRegistry.fetchDevfile(this.devfileRegistryUrl, selfLink).then(() => { const devfile = this.devfileRegistry.getDevfile(this.devfileRegistryUrl, selfLink); + if (this.ephemeralMode) { + if (!devfile.attributes) { + devfile.attributes = {}; + } + devfile.attributes.persistVolumes = 'false'; + } const attributes = {stackName: this.selectedDevfile.displayName}; return this.createWorkspaceSvc.createWorkspaceFromDevfile(undefined, devfile, attributes, true); }); diff --git a/dashboard/src/app/get-started/template-list/template-list.html b/dashboard/src/app/get-started/template-list/template-list.html index a150274a706..e672e743b76 100644 --- a/dashboard/src/app/get-started/template-list/template-list.html +++ b/dashboard/src/app/get-started/template-list/template-list.html @@ -30,6 +30,20 @@
Select a Sample
Use a sample to create your first workspace.
+
+
Temporary Storage
+ + + + + +