fix: split report global keys into raw and computed across plugins
The `<plugin>-global-<property>` keys in `:report` output returned the resolved value with the built-in default substituted in, so external tooling could not distinguish a property that had been set globally to the default from one that had never been set. The bare keys for caddy, haproxy, and traefik global-only properties had the same shape. The `global-<property>` keys now hold the raw stored value and are empty when nothing has been set, and a new `computed-<property>` key holds the effective value used at runtime, falling back through the per-app value (where one exists), the global value, and the built-in default. The bare global-only keys for the three proxy plugins are removed in favor of the raw/computed pair. Closes #8631.
This commit is contained in:
@@ -10,17 +10,29 @@ teardown() {
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(scheduler-docker-local:report) --global --scheduler-docker-local-global-init-process" {
|
||||
@test "(scheduler-docker-local:report) --global raw and computed keys" {
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report --global --scheduler-docker-local-global-init-process"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report --global --scheduler-docker-local-computed-init-process"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report --global --scheduler-docker-local-global-parallel-schedule-count"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report --global --scheduler-docker-local-computed-parallel-schedule-count"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "1"
|
||||
}
|
||||
|
||||
@@ -46,7 +58,7 @@ teardown() {
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "1"
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report $TEST_APP --scheduler-docker-local-init-process"
|
||||
echo "output: $output"
|
||||
@@ -64,7 +76,7 @@ teardown() {
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report $TEST_APP --scheduler-docker-local-invalid-flag"
|
||||
echo "output: $output"
|
||||
@@ -99,7 +111,7 @@ teardown() {
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report $TEST_APP --format json | jq -r '.\"global-init-process\"'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "true"
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report $TEST_APP --format json | jq -r '.\"parallel-schedule-count\"'"
|
||||
echo "output: $output"
|
||||
@@ -114,7 +126,7 @@ teardown() {
|
||||
run /bin/bash -c "dokku scheduler-docker-local:report $TEST_APP --format json | jq -r '.\"global-parallel-schedule-count\"'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "1"
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-docker-local:set $TEST_APP init-process false"
|
||||
echo "output: $output"
|
||||
|
||||
Reference in New Issue
Block a user