-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Using a non-valid cpus value, silently ignores it #11634
Copy link
Copy link
Closed
compose-spec/compose-go
#604Labels
Description
Description
Compose is in general rejecting non-valid configurations, even unknown keys are rejected (except x- prefixed).
But providing a non-valid formatted value for cpus silently ignores the parsing error.
eg try to set deploy.resources.limits.cpus to 1000m, it will ignore it (not even a warning) and will not apply any limits.
As someone that uses k8s and docker frequently I mix them up sometimes. Not having at least a warning, creates issues like containers abusing resources unexpectedly. (Though is a user error in this case).
Code point that ignores the parsing error:
Line 665 in 86cd523
| if f, err := strconv.ParseFloat(limits.NanoCPUs, 64); err == nil { |
Reactions are currently unavailable