mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 06:09:17 +00:00
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:
1 parent
1c29d4d5d0
commit
aaf67687d2
2 files changed
+113
-5
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user