fix: reject per-app sets for openresty global-only properties

`openresty:set <app>` previously accepted per-app writes for properties whose readers only consult the global store, so `:set myapp image foo` printed a success message while `:report myapp` kept showing the global default. The per-app form is now rejected with `The key '<key>' can only be set globally`, matching the behavior introduced for `caddy`, `haproxy`, and `traefik` in #8602.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-11 22:55:37 -04:00
parent db2cbd802f
commit ebdd5f2b2f
2 changed files with 32 additions and 0 deletions

View File

@@ -26,6 +26,33 @@ teardown() {
assert_output "https://acme-staging-v02.api.letsencrypt.org/directory"
}
@test "(openresty) global-only keys" {
for key in allowed-letsencrypt-domains-func-base64 image log-level letsencrypt-email letsencrypt-server; do
run /bin/bash -c "dokku openresty:set $TEST_APP $key somevalue"
echo "key: $key"
echo "output: $output"
echo "status: $status"
assert_failure
assert_output_contains "can only be set globally"
done
run /bin/bash -c "dokku openresty:set $TEST_APP bind-address-ipv4 127.0.0.1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku openresty:report $TEST_APP --openresty-bind-address-ipv4"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "127.0.0.1"
run /bin/bash -c "dokku openresty:set $TEST_APP bind-address-ipv4"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(openresty) openresty:help" {
run /bin/bash -c "dokku openresty"
echo "output: $output"