fix: accept all docker memory units in resource values

Memory values with uppercase or other docker-supported units such as `1G`, `512M` or `1GiB` are now passed to docker unchanged instead of having an extra `m` appended, and the k3s scheduler interprets memory values with the same binary units so a value means the same thing on both schedulers. Invalid `--memory` and `--memory-swap` values are now rejected by `resource:limit` and `resource:reserve`. Closes #9153.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-10-21 14:07:00 -04:00
1 parent fa0f031560
commit c8e28c2445
13 files changed
+382 -30

No files matched your search

+16
View File
@@ -59,6 +59,22 @@ teardown() {
echo "status: $status"
assert_output "536870912"
run /bin/bash -c "dokku resource:limit --memory 1G $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
CID=$(<$DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run /bin/bash -c "docker inspect --format '{{.HostConfig.Memory}}' $CID"
echo "output: $output"
echo "status: $status"
assert_output "1073741824"
run /bin/bash -c "dokku resource:limit --memory 512 $TEST_APP"
echo "output: $output"
echo "status: $status"