mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
resource.Quantity.Mul returns false when the product no longer fits an
int64 coefficient, not when it is wrong: it carries on in arbitrary
precision. The evaluator read that as an overflow and failed with
"quantity 20992Mi * 3 overflows" for any fractional binary quantity
above about 8.5Gi, since such a quantity is stored at a scale whose
coefficient leaves int64 long before its value does. Declared sizes
like 20.5Gi are ordinary, so every pool or disk using one could not be
reserved.
Tested with fractional Gi and Ti quantities scaled directly and after a
sum.
Fixes: 89aba6e104 ("feat(api): add the reservation evaluator for tenant quotas")
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>