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:
Jose Diaz-Gonzalez
2026-05-13 16:39:38 -04:00
parent f3bdd7e4ec
commit 76b033234f
56 changed files with 1031 additions and 334 deletions

View File

@@ -23,13 +23,31 @@ teardown() {
dokku nginx:start
}
@test "(traefik:report) --global --traefik-log-level" {
@test "(traefik:report) --global global vs computed log-level" {
run /bin/bash -c "dokku traefik:report --global --traefik-global-log-level"
echo "output: $output"
echo "status: $status"
assert_success
assert_output ""
run /bin/bash -c "dokku traefik:report --global --traefik-computed-log-level"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "ERROR"
run /bin/bash -c "dokku traefik:set --global log-level DEBUG"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku traefik:report --global --traefik-log-level"
run /bin/bash -c "dokku traefik:report --global --traefik-global-log-level"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "DEBUG"
run /bin/bash -c "dokku traefik:report --global --traefik-computed-log-level"
echo "output: $output"
echo "status: $status"
assert_success
@@ -39,6 +57,44 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku traefik:report --global --traefik-global-log-level"
echo "output: $output"
echo "status: $status"
assert_success
assert_output ""
run /bin/bash -c "dokku traefik:report --global --traefik-computed-log-level"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "ERROR"
}
@test "(traefik:report) --global raw and computed keys in --format json" {
run /bin/bash -c "dokku --quiet traefik:report --global --format json | jq -r '.\"global-api-vhost\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet traefik:report --global --format json | jq -r '.\"computed-api-vhost\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "traefik.dokku.me"
run /bin/bash -c "dokku --quiet traefik:report --global --format json | jq -r '.\"global-dashboard-enabled\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet traefik:report --global --format json | jq -r '.\"computed-dashboard-enabled\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "false"
}
@test "(traefik) global-only keys" {
@@ -409,7 +465,7 @@ teardown() {
}
@test "(traefik) [dns-01] challenge-mode property" {
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-challenge-mode"
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-computed-challenge-mode"
echo "output: $output"
echo "status: $status"
assert_success
@@ -420,7 +476,7 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-challenge-mode"
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-computed-challenge-mode"
echo "output: $output"
echo "status: $status"
assert_success
@@ -431,7 +487,7 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-challenge-mode"
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-computed-challenge-mode"
echo "output: $output"
echo "status: $status"
assert_success
@@ -439,7 +495,7 @@ teardown() {
}
@test "(traefik) [dns-01] dns-provider property" {
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-dns-provider"
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-computed-dns-provider"
echo "output: $output"
echo "status: $status"
assert_success
@@ -450,7 +506,7 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-dns-provider"
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-computed-dns-provider"
echo "output: $output"
echo "status: $status"
assert_success
@@ -461,7 +517,7 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-dns-provider"
run /bin/bash -c "dokku traefik:report $TEST_APP --traefik-computed-dns-provider"
echo "output: $output"
echo "status: $status"
assert_success