mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-16 16:37:10 +08:00
vendor: update compose to v2.4.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
12
vendor/github.com/compose-spec/compose-go/v2/validation/validation.go
generated
vendored
12
vendor/github.com/compose-spec/compose-go/v2/validation/validation.go
generated
vendored
@ -30,6 +30,8 @@ var checks = map[tree.Path]checkerFunc{
|
||||
"configs.*": checkFileObject("file", "environment", "content"),
|
||||
"secrets.*": checkFileObject("file", "environment"),
|
||||
"services.*.develop.watch.*.path": checkPath,
|
||||
"services.*.deploy.resources.reservations.devices.*": checkDeviceRequest,
|
||||
"services.*.gpus.*": checkDeviceRequest,
|
||||
}
|
||||
|
||||
func Validate(dict map[string]any) error {
|
||||
@ -94,3 +96,13 @@ func checkPath(value any, p tree.Path) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkDeviceRequest(value any, p tree.Path) error {
|
||||
v := value.(map[string]any)
|
||||
_, hasCount := v["count"]
|
||||
_, hasIds := v["device_ids"]
|
||||
if hasCount && hasIds {
|
||||
return fmt.Errorf(`%s: "count" and "device_ids" attributes are exclusive`, p)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user