diff --git a/plugins/resource/subcommands.go b/plugins/resource/subcommands.go index e3a8f68b6..b607a4609 100644 --- a/plugins/resource/subcommands.go +++ b/plugins/resource/subcommands.go @@ -121,10 +121,11 @@ func setResourceType(appName string, processType string, r Resource, resourceTyp common.LogInfo2Quiet(message) for key, value := range resources { - if value != "" { - common.LogVerbose(fmt.Sprintf("%v: %v", key, value)) + if value == "" { + continue } + common.LogVerbose(fmt.Sprintf("%v: %v", key, value)) property := propertyKey(processType, resourceType, key) err := common.PropertyWrite("resource", appName, property, value) if err != nil { diff --git a/tests/unit/20_resource.bats b/tests/unit/20_resource.bats index a8f92cc89..0ee9bef0a 100644 --- a/tests/unit/20_resource.bats +++ b/tests/unit/20_resource.bats @@ -116,6 +116,11 @@ teardown() { echo "status: $status" assert_success + run /bin/bash -c "dokku resource:reserve --cpu 1.5 --process-type worker $TEST_APP" + echo "output: $output" + echo "status: $status" + assert_success + dokku ps:rebuild "$TEST_APP" CID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1) run /bin/bash -c "docker inspect --format '{{.HostConfig.MemoryReservation}}' $CID"