Rename to print-config

This commit is contained in:
Lennard Schwarz 2026-01-01 17:14:03 +01:00
parent a826828d76
commit 17f1e33b8a
No known key found for this signature in database
GPG key ID: A6BE8A5D7587024D
8 changed files with 12 additions and 12 deletions

View file

@ -16,8 +16,8 @@ func main() {
if len(additionalArgs) > 0 {
switch additionalArgs[0] {
case "show-config":
c.must(runShowConfig())
case "print-config":
c.must(runPrintConfig())
return
default:
panic("unknown command: " + additionalArgs[0])

View file

@ -11,7 +11,7 @@ import (
"github.com/offen/docker-volume-backup/internal/errwrap"
)
func runShowConfig() error {
func runPrintConfig() error {
configurations, err := sourceConfiguration(configStrategyConfd)
if err != nil {
fmt.Printf("error sourcing configuration: %v\n", err) // print error to stdout for debugging

View file

@ -5,12 +5,12 @@ parent: How Tos
nav_order: 8
---
# Show loaded configuration
# Print loaded configuration
You can print the configuration that `docker-volume-backup` has picked up without running a backup:
```console
docker exec <container_ref> backup show-config
docker exec <container_ref> backup print-config
```
If configuration sourcing fails, the error is printed to stdout to aid debugging.
@ -18,7 +18,7 @@ If configuration sourcing fails, the error is printed to stdout to aid debugging
If you want to test a one-off value, pass it directly:
```console
docker exec -e BACKUP_SOURCES=/backup -e NOTIFICATION_URLS=stdout:// <container_ref> backup show-config
docker exec -e BACKUP_SOURCES=/backup -e NOTIFICATION_URLS=stdout:// <container_ref> backup print-config
```
Note: output includes secrets exactly as loaded.

View file

@ -19,7 +19,7 @@ You can work around this by either updating `docker-compose` or unquoting your c
You can populate below template according to your requirements and use it as your `env_file`.
The values for each key currently match its default.
If you need to confirm what the container actually loaded, see [Show loaded configuration](../how-tos/show-configuration.md).
If you need to confirm what the container actually loaded, see [Show loaded configuration](../how-tos/print-configuration.md).
{% raw %}
```

View file

@ -6,9 +6,9 @@ cd "$(dirname "$0")"
. ../util.sh
current_test=$(basename $(pwd))
info "show-config with environment variables"
info "print-config with environment variables"
docker compose up -d --quiet-pull
logs=$(docker compose exec -T backup backup show-config)
logs=$(docker compose exec -T backup backup print-config)
echo "$logs"
@ -39,17 +39,17 @@ pass "AWS_S3_BUCKET_NAME present."
docker compose down
info "show-config with conf.d and _FILE"
info "print-config with conf.d and _FILE"
export CONF_DIR=$(pwd)/conf.d
export SECRET_FILE=$(mktemp)
printf "stdout://\n" > "$SECRET_FILE"
docker compose -f docker-compose.confd.yml up -d --quiet-pull
logs=$(docker compose -f docker-compose.confd.yml exec -T backup backup show-config)
logs=$(docker compose -f docker-compose.confd.yml exec -T backup backup print-config)
echo "$logs"
if ! echo "$logs" | grep -q "source=01show-config.env"; then
if ! echo "$logs" | grep -q "source=01print-config.env"; then
fail "Missing conf.d source line."
fi
pass "conf.d source line present."