Skip to content

Commit ce4e7b6

Browse files
Merge branch 'main' into newline-fix
2 parents 780fd47 + 2d81ee3 commit ce4e7b6

5 files changed

Lines changed: 30 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
Notable changes.
44

5+
## April 2026
6+
7+
### [0.86.0]
8+
- Bump basic-ftp from 5.2.0 to 5.2.2. (https://github.com/devcontainers/cli/pull/1201)
9+
- Always write devcontainer.metadata label as JSON array. (https://github.com/devcontainers/cli/pull/1199)
10+
- Normalize drive letter to lowercase on Windows to match VSCode. (https://github.com/devcontainers/cli/pull/1183)
11+
512
## March 2026
613

714
### [0.85.0]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@devcontainers/cli",
33
"description": "Dev Containers CLI",
4-
"version": "0.85.0",
4+
"version": "0.86.0",
55
"bin": {
66
"devcontainer": "devcontainer.js"
77
},

src/spec-node/imageMetadata.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,9 @@ export function getDevcontainerMetadataLabel(devContainerMetadata: SubstitutedCo
497497
if (!metadata.length) {
498498
return '';
499499
}
500-
const imageMetadataLabelValue = metadata.length !== 1
501-
? `[${metadata
502-
.map(feature => ` \\\n${toLabelString(feature)}`)
503-
.join(',')} \\\n]`
504-
: toLabelString(metadata[0]);
500+
const imageMetadataLabelValue = `[${metadata
501+
.map(feature => ` \\\n${toLabelString(feature)}`)
502+
.join(',')} \\\n]`;
505503
return `LABEL ${imageMetadataLabel}="${imageMetadataLabelValue}"`;
506504
}
507505

src/test/imageMetadata.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,22 @@ describe('Image Metadata', function () {
432432
assert.strictEqual(label.replace(/ \\\n/g, ''), `LABEL devcontainer.metadata="${JSON.stringify(expected).replace(/"/g, '\\"')}"`);
433433
});
434434

435+
it('should create array label for single metadata entry (docker-compose with Dockerfile, no features)', () => {
436+
// When there is only one metadata entry, the label should still be a JSON array.
437+
// Regression test for https://github.com/devcontainers/cli/issues/1054
438+
const label = getDevcontainerMetadataLabel(configWithRaw([
439+
{
440+
remoteUser: 'testUser',
441+
}
442+
]));
443+
const expected = [
444+
{
445+
remoteUser: 'testUser',
446+
}
447+
];
448+
assert.strictEqual(label.replace(/ \\\n/g, ''), `LABEL devcontainer.metadata="${JSON.stringify(expected).replace(/"/g, '\\"')}"`);
449+
});
450+
435451
it('should merge metadata from devcontainer.json and features', () => {
436452
const merged = mergeConfiguration({
437453
configFilePath: URI.parse('file:///devcontainer.json'),

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@ base64-js@^1.3.1:
639639
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
640640

641641
basic-ftp@^5.0.2:
642-
version "5.2.0"
643-
resolved "https://registry.yarnpkg.com/basic-ftp/-/basic-ftp-5.2.0.tgz#7c2dff63c918bde60e6bad1f2ff93dcf5137a40a"
644-
integrity sha512-VoMINM2rqJwJgfdHq6RiUudKt2BV+FY5ZFezP/ypmwayk68+NzzAQy4XXLlqsGD4MCzq3DrmNFD/uUmBJuGoXw==
642+
version "5.2.2"
643+
resolved "https://registry.yarnpkg.com/basic-ftp/-/basic-ftp-5.2.2.tgz#4cb2422deddf432896bdb3c9b8f13b944ad4842c"
644+
integrity sha512-1tDrzKsdCg70WGvbFss/ulVAxupNauGnOlgpyjKzeQxzyllBLS0CGLV7tjIXTK3ZQA9/FBEm9qyFFN1bciA6pw==
645645

646646
bl@^5.0.0:
647647
version "5.1.0"

0 commit comments

Comments
 (0)