fix: do not crash when clearing properties

This commit is contained in:
Jose Diaz-Gonzalez committed 2019-04-08 13:56:06 -04:00
1 parent beef464cc1
commit 4a6d3c25a4
2 files changed
+26 -8

No files matched your search

+2 -8
View File
@@ -63,10 +63,7 @@ func clearByRequestType(appName string, processType string, requestType string)
return err return err
} }
for key := range resources { for key := range resources {
err := common.PropertyDelete("resource", appName, key) common.PropertyDelete("resource", appName, key)
if err != nil {
return err
}
} }
} else { } else {
resources := []string{ resources := []string{
@@ -80,10 +77,7 @@ func clearByRequestType(appName string, processType string, requestType string)
for _, key := range resources { for _, key := range resources {
property := propertyKey(processType, requestType, key) property := propertyKey(processType, requestType, key)
err := common.PropertyDelete("resource", appName, property) common.PropertyDelete("resource", appName, property)
if err != nil {
return err
}
} }
} }
return nil return nil
+24
View File
@@ -135,3 +135,27 @@ teardown() {
echo "status: $status" echo "status: $status"
assert_output "0" assert_output "0"
} }
@test "(docker-options) resource:limit-clear" {
run /bin/bash -c "dokku resource:limit-clear $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku resource:limit-clear --process-type web $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(docker-options) resource:reserve-clear" {
run /bin/bash -c "dokku resource:reserve-clear $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku resource:reserve-clear --process-type web $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
}