Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in features with explicit port numbers #523

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/spec-configuration/containerFeaturesOCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function tryGetOCIFeatureSet(output: Log, identifier: string, options: bo
value: options
};

const userFeatureIdWithoutVersion = originalUserFeatureId.split(':')[0];
const userFeatureIdWithoutVersion = featureRef.resource;
let featureSet: FeatureSet = {
sourceInformation: {
type: 'oci',
Expand Down
4 changes: 2 additions & 2 deletions src/spec-configuration/containerFeaturesOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function computeInstallationOrder(features: FeatureSet[]) {
feature,
before: new Set(),
after: new Set(),
})).reduce((map, feature) => map.set(feature.feature.sourceInformation.userFeatureId.split(':')[0], feature), new Map<string, FeatureNode>());
})).reduce((map, feature) => map.set(feature.feature.sourceInformation.userFeatureIdWithoutVersion || feature.feature.sourceInformation.userFeatureId, feature), new Map<string, FeatureNode>());

let nodes = [...nodesById.values()];

Expand Down Expand Up @@ -124,7 +124,7 @@ export function computeInstallationOrder(features: FeatureSet[]) {

const missing = new Set(nodesById.keys());
for (const feature of orderedFeatures) {
missing.delete(feature.sourceInformation.userFeatureId.split(':')[0]);
missing.delete(feature.sourceInformation.userFeatureIdWithoutVersion || feature.sourceInformation.userFeatureId);
}

if (missing.size !== 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async function addsAdditionalTemplateProps(srcFolder: string, devcontainerTempla

templateData.type = type;
templateData.fileCount = (await recursiveDirReader.default(srcFolder)).length;
templateData.featureIds = config.features ? Object.keys(config.features).map((k) => k.split(':')[0]) : [];
templateData.featureIds = config.features ? Object.keys(config.features).map((k) => k.split(':').slice(0, -1).join(':')) : [];

await writeLocalFile(devcontainerTemplateJsonPath, JSON.stringify(templateData, null, 4));

Expand Down