refactor: rename computed-* helpers, expose computed vector and network keys
Addresses review feedback on #8640. fn-archive-max-size, fn-archive-max-files, fn-git-deploy-branch, and fn-git-keep-git-dir are renamed with `computed` in the function name so the names match the resolved-with-default semantic they implement, and every caller is updated in lockstep. logs:report renames the misordered --logs-vector-global-image and --logs-vector-global-networks to --logs-global-vector-image and --logs-global-vector-networks, makes the global getters return the raw stored value, and adds --logs-computed-vector-image, --logs-computed-vector-networks, and --logs-computed-vector-sink. network:report --global gains the computed-* keys for attach-post-create, attach-post-deploy, initial-network, and tld so external tooling can read the resolved value at global scope. The --quiet flag is dropped from every :report --format json | jq invocation across the PR's bats files; the report's --format json output is the only stdout and the flag is redundant.
This commit is contained in:
22 files changed
+200
-174
No files matched your search
+16
-16
@@ -137,40 +137,40 @@ teardown() {
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-image-repo\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-image-repo\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
# When neither per-app image-repo nor a global image-repo-template are set,
|
||||
# reportComputedImageRepo falls back to common.GetAppImageRepo which returns
|
||||
# the default dokku/<app> image name.
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "dokku/$TEST_APP"
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template 'dokku/{{ APP }}'"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output 'dokku/{{ APP }}'
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "dokku/$TEST_APP"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP image-repo my/$TEST_APP"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-image-repo\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "my/$TEST_APP"
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "my/$TEST_APP"
|
||||
|
||||
@@ -185,37 +185,37 @@ teardown() {
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release true"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP push-on-release false"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
@@ -227,14 +227,14 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(registry:report) push-extra-tags raw" {
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP push-extra-tags release,stable"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
run /bin/bash -c "dokku registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
assert_success
|
||||
assert_output "release,stable"
|
||||
|
||||
|
||||
Reference in new issue
Block a user