mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-21 12:13:55 +09:00
parseQuantity and the request-above-limit check were closures inside main(), so no branch of either was reachable from a test: not empty, not malformed, not negative, not a request of 0 against a real limit, and not the pair check itself. That last one is the one worth having. A limit and a request that each parse but contradict each other produce a LimitRange the API server rejects, once per system namespace on every Package reconcile, and nothing in that error points back at a flag. Lift both into parseSystemNamespaceMemory, which returns an error instead of calling os.Exit, and pin all of it: the shipped defaults, empty as the off switch, an explicit 0 limit beside a set request, a 0 request against a real limit (supported on purpose), malformed and negative values on either flag, request above limit, and request equal to limit as the legal boundary. main() keeps the same exit-on-error behaviour, now in one place. Assisted-By: LLM Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>