fix: split more report global keys into raw and computed
Three plugins still leaked the built-in default through `<plugin>-global-<property>` after the broader raw/computed split in #8640. External tooling reading `:report --format json` for drift detection could not distinguish "set to default" from "never set" - after a `:set --global` followed by an unset, the JSON still reported the default value. The `<plugin>-global-<property>` keys now hold the raw stored value (empty when nothing has been set) and `<plugin>-computed-<property>` keys hold the effective value with per-app, global, and built-in default fallback. Every global property now has a computed sibling for shape consistency, including those whose default is empty. Internal callers in `scheduler-k3s` that previously read the default-applied global helpers now consume new `getComputed*` helpers, keeping deploy-time behavior unchanged.
This commit is contained in:
15 files changed
+575
-162
No files matched your search
@@ -226,6 +226,77 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(registry:report --global) computed and global keys" {
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku registry:set --global server"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-global-server\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-computed-server\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-computed-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release true"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku registry:set --global server ghcr.io"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template 'dokku/{{ APP }}'"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-global-server\"'"
|
||||
assert_success
|
||||
assert_output "ghcr.io"
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-computed-server\"'"
|
||||
assert_success
|
||||
assert_output "ghcr.io/"
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output 'dokku/{{ APP }}'
|
||||
|
||||
run /bin/bash -c "dokku registry:report --global --format json | jq -r '.\"registry-computed-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output 'dokku/{{ APP }}'
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku registry:set --global server"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(registry:report) push-extra-tags raw" {
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
assert_success
|
||||
|
||||
Reference in new issue
Block a user