fix: correct issue where resource setting was overriding pre-existing values

This commit is contained in:
Jose Diaz-Gonzalez
2019-05-17 11:58:53 -04:00
parent c786b9e45e
commit ceac86b58f
2 changed files with 8 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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"