mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
fix: do not crash when clearing properties
This commit is contained in:
@@ -63,10 +63,7 @@ func clearByRequestType(appName string, processType string, requestType string)
|
||||
return err
|
||||
}
|
||||
for key := range resources {
|
||||
err := common.PropertyDelete("resource", appName, key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
common.PropertyDelete("resource", appName, key)
|
||||
}
|
||||
} else {
|
||||
resources := []string{
|
||||
@@ -80,10 +77,7 @@ func clearByRequestType(appName string, processType string, requestType string)
|
||||
|
||||
for _, key := range resources {
|
||||
property := propertyKey(processType, requestType, key)
|
||||
err := common.PropertyDelete("resource", appName, property)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
common.PropertyDelete("resource", appName, property)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -135,3 +135,27 @@ teardown() {
|
||||
echo "status: $status"
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user