Skip to content

Commit

Permalink
Merge pull request #470 from che-incubator/debug-restart-from-local-d…
Browse files Browse the repository at this point in the history
…evfile

fix: restart from local devfile should work even whem some attributes are empty
  • Loading branch information
RomanNikitenko authored Jan 2, 2025
2 parents f6b6fb0 + f9e2233 commit 98b032b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/extensions/che-remote/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,13 @@ async function updateDevfile(cheApi: any): Promise<boolean> {
try {
// keep spec.template.attributes
if (!devfileContext.devWorkspace.spec!.template!.attributes) {
devfileContext.devWorkspace.spec!.template!.attributes = flattenedDevfile.attributes;
devfileContext.devWorkspace.spec!.template!.attributes = {};
}

for (const key of Object.keys(flattenedDevfile.attributes)) {
if (flattenedDevfile.attributes[key]) {
devfileContext.devWorkspace.spec!.template!.attributes[key] = flattenedDevfile.attributes[key];
}
}
} catch (error) {
await vscode.window.showErrorMessage(`Failed to update DevWorkspace attributes. ${error}`);
Expand Down

0 comments on commit 98b032b

Please sign in to comment.