Commit c6f3d47
authored
fix: always write devcontainer.metadata label as JSON array (#1199)
* fix: always write devcontainer.metadata label as JSON array
When there is only one metadata entry (e.g. docker-compose devcontainer
with no features), `getDevcontainerMetadataLabel` wrote a bare JSON
object instead of an array. This violates the spec which states the
label "can contain an array of json snippets" and causes tools like Zed
that expect an array to fail when attaching to an existing container.
Always wrap the metadata in an array regardless of the number of entries.
Spec reference: https://containers.dev/implementors/json_reference/
Fixes #1054
* cleanup: remove unnecessary spaces
* test: add test for single metadata entry always being an array1 parent 997a2db commit c6f3d47
2 files changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
505 | 503 | | |
506 | 504 | | |
507 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
435 | 451 | | |
436 | 452 | | |
437 | 453 | | |
| |||
0 commit comments