fix: expose remaining settable properties via :report
Adds the missing raw/global/computed report keys for ten settable properties across the ps, builder, scheduler, proxy, openresty, nginx, and scheduler-k3s plugins so external tooling can verify drift through `:report --format json`. The scheduler-k3s `token` is masked as `*******` in default stdout output and only unmasked when the report is requested via `--format json` or when the flag is queried explicitly by name; the same explicit-query unmasking rule is extended to the existing traefik `dns-provider-<env_var>` keys.
This commit is contained in:
28 files changed
+734
-50
No files matched your search
@@ -7,7 +7,7 @@ setup() {
|
||||
}
|
||||
|
||||
teardown() {
|
||||
for prop in deploy-timeout image-pull-secrets ingress-class kubeconfig-path kube-context kustomize-root-path namespace network-interface rollback-on-failure shm-size; do
|
||||
for prop in deploy-timeout image-pull-secrets ingress-class kubeconfig-path kube-context kustomize-root-path namespace network-interface rollback-on-failure shm-size token; do
|
||||
dokku scheduler-k3s:set --global "$prop" >/dev/null 2>/dev/null || true
|
||||
done
|
||||
global_teardown
|
||||
@@ -122,3 +122,39 @@ assert_k3s_global_unset_set() {
|
||||
assert_success
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "(scheduler-k3s:report --global) token masked in stdout but exposed via json or explicit flag" {
|
||||
run /bin/bash -c "dokku scheduler-k3s:set --global token"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -e 'has(\"scheduler-k3s-global-token\")'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -r '.\"scheduler-k3s-global-token\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:report --global --scheduler-k3s-global-token"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:set --global token sometoken"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:report --global"
|
||||
assert_success
|
||||
assert_output_contains "*******"
|
||||
assert_output_not_contains "sometoken"
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -r '.\"scheduler-k3s-global-token\"'"
|
||||
assert_success
|
||||
assert_output "sometoken"
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:report --global --scheduler-k3s-global-token"
|
||||
assert_success
|
||||
assert_output "sometoken"
|
||||
|
||||
run /bin/bash -c "dokku scheduler-k3s:set --global token"
|
||||
assert_success
|
||||
}
|
||||
Reference in new issue
Block a user