New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-che/che-code-devworkspace-handler

Package Overview
Dependencies
Maintainers
5
Versions
331
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-che/che-code-devworkspace-handler - npm Package Compare versions

Comparing version 1.63.0-dev-711e3f8 to 1.63.0-dev-72b1407

27

lib/devfile/dev-container-component-updater.js

@@ -65,6 +65,7 @@ "use strict";

DevContainerComponentUpdater.prototype.update = function (devfileContext, cheCodeDescriptionComponent, devContainerComponent, devContainerExisted) {
var _a;
return __awaiter(this, void 0, void 0, function () {
var devContainer, cheCodeDescriptionComponentContainer, devContainerAttributes, existingEntrypoint, devContainerVolumes, toInsertVolumeMounts, existingComponents, volumeComponentsToAdd, devContainerEndpoints, cheCodeContainerEndpoints;
var _a, _b;
return __generator(this, function (_c) {
var devContainer, cheCodeDescriptionComponentContainer, devContainerAttributes, existingEntrypoint, devContainerVolumes, toInsertVolumeMounts, existingComponents, volumesInsideTemplates, volumeComponentsToAdd, devContainerEndpoints, cheCodeContainerEndpoints;
var _b, _c;
return __generator(this, function (_d) {
devContainer = devContainerComponent.container;

@@ -95,3 +96,3 @@ if (!devContainer) {

toInsertVolumeMounts = (cheCodeDescriptionComponentContainer.volumeMounts || []).filter(function (volume) { return !devContainerVolumes.some(function (containerVolume) { return containerVolume.name === volume.name; }); });
(_a = devContainer.volumeMounts).push.apply(_a, toInsertVolumeMounts);
(_b = devContainer.volumeMounts).push.apply(_b, toInsertVolumeMounts);
// add information that this volume has been added

@@ -103,3 +104,17 @@ toInsertVolumeMounts.forEach(function (volumeMount) {

existingComponents = devfileContext.devWorkspace.spec.template.components;
volumeComponentsToAdd = toInsertVolumeMounts.filter(function (volumeMount) { return !existingComponents.find(function (component) { return component.volume && component.name == volumeMount.name; }); });
volumesInsideTemplates = (_a = devfileContext.devWorkspaceTemplates) === null || _a === void 0 ? void 0 : _a.map(function (template) { return template.spec.components; }).map(function (components) {
return components.map(function (component) {
if (component.volume) {
return component.name;
}
else {
return undefined;
}
});
}).filter(function (defined) { return defined; }).flat();
volumeComponentsToAdd = toInsertVolumeMounts
.filter(function (volumeMount) { return !existingComponents.find(function (component) { return component.volume && component.name == volumeMount.name; }); })
.filter(
// also filter out all volumes that are defined in the editor template
function (volumeMount) { return !(volumesInsideTemplates || []).includes(volumeMount.name); });
volumeComponentsToAdd.forEach(function (volume) {

@@ -114,3 +129,3 @@ // volume

// add all endpoints
(_b = devContainer.endpoints).push.apply(_b, cheCodeContainerEndpoints);
(_c = devContainer.endpoints).push.apply(_c, cheCodeContainerEndpoints);
cheCodeContainerEndpoints.forEach(function (endpoint) {

@@ -117,0 +132,0 @@ var endpointAttributes = endpoint.attributes || {};

{
"name": "@eclipse-che/che-code-devworkspace-handler",
"version": "1.63.0-dev-711e3f8",
"version": "1.63.0-dev-72b1407",
"private": false,

@@ -5,0 +5,0 @@ "description": "Handle management of devWorkspace templates for che-code",

@@ -96,6 +96,27 @@ /**********************************************************************

const existingComponents = devfileContext.devWorkspace.spec.template.components;
// volumes defined in the templates
const volumesInsideTemplates = devfileContext.devWorkspaceTemplates
?.map(template => template.spec.components)
.map(components =>
components.map(component => {
if (component.volume) {
return component.name;
} else {
return undefined;
}
})
)
.filter(defined => defined)
.flat();
// keep only volumes that match the given component
const volumeComponentsToAdd = toInsertVolumeMounts.filter(
volumeMount => !existingComponents.find(component => component.volume && component.name == volumeMount.name)
);
const volumeComponentsToAdd = toInsertVolumeMounts
.filter(
volumeMount => !existingComponents.find(component => component.volume && component.name == volumeMount.name)
)
.filter(
// also filter out all volumes that are defined in the editor template
volumeMount => !(volumesInsideTemplates || []).includes(volumeMount.name)
);
volumeComponentsToAdd.forEach(volume => {

@@ -102,0 +123,0 @@ // volume

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc