feat: validate remaining unsupported items of the support-matrix (#429)

* feat: validate remaining unsupported items of the support-matrix

Validate unsupported compose features: external configs, container_name,
and placement.

This makes the code match the support-matrix as of now (added comment to
that effect as well).

Signed-off-by: Miek Gieben <miek@miek.nl>

* support matrix: some deploy modes are supported

Add tests for the various non-supported deploy modes.
Prefix the warnings with `deploy ` to signal the section, and to
differentiate between top level 'labels' and 'deploy labels'.

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben authored and GitHub committed 2026-09-04 10:40:03 +10:00
1 parent 1c29d4d5d0
commit aaf67687d2
2 files changed
+113 -5

No files matched your search

+73
View File
@@ -322,6 +322,79 @@ volumes:
`,
shouldErr: true,
},
{
name: "external configs",
composeYAML: `services:
app:
image: myapp:latest
configs:
http_config:
external: true
`,
warnCount: 1,
warnContains: []string{"external"},
},
{
name: "container_name",
composeYAML: `services:
app:
image: myapp:latest
container_name: my_container
`,
warnCount: 1,
warnContains: []string{"container_name"},
},
{
name: "deploy mode",
composeYAML: `services:
app:
image: myapp:latest
deploy:
mode: replicated-job
replicas: 2
`,
warnCount: 1,
warnContains: []string{"deploy mode must"},
},
{
name: "deploy mode",
composeYAML: `services:
app:
image: myapp:latest
deploy:
mode: replicated
labels:
- foo
replicas: 2
`,
warnCount: 1,
warnContains: []string{"deploy labels"},
},
{
name: "deploy restart_policy",
composeYAML: `services:
app:
image: myapp:latest
deploy:
restart_policy:
condition: on-failure
`,
warnCount: 1,
warnContains: []string{"deploy restart_policy"},
},
{
name: "deploy placement",
composeYAML: `services:
app:
image: myapp:latest
deploy:
placement:
preferences:
- spread: foo
`,
warnCount: 1,
warnContains: []string{"deploy placement"},
},
}
for _, tt := range tests {