From 17f1e33b8a40aa6a63ac3e81f2fd890bb846bb3f Mon Sep 17 00:00:00 2001 From: Lennard Schwarz Date: Thu, 1 Jan 2026 17:14:03 +0100 Subject: [PATCH] Rename to print-config --- cmd/backup/main.go | 4 ++-- cmd/backup/{show_config.go => print_config.go} | 2 +- .../{show-configuration.md => print-configuration.md} | 6 +++--- docs/reference/index.md | 2 +- .../conf.d/01print-config.env} | 0 .../docker-compose.confd.yml | 0 test/{show-config => print-config}/docker-compose.yml | 0 test/{show-config => print-config}/run.sh | 10 +++++----- 8 files changed, 12 insertions(+), 12 deletions(-) rename cmd/backup/{show_config.go => print_config.go} (98%) rename docs/how-tos/{show-configuration.md => print-configuration.md} (80%) rename test/{show-config/conf.d/01show-config.env => print-config/conf.d/01print-config.env} (100%) rename test/{show-config => print-config}/docker-compose.confd.yml (100%) rename test/{show-config => print-config}/docker-compose.yml (100%) rename test/{show-config => print-config}/run.sh (87%) diff --git a/cmd/backup/main.go b/cmd/backup/main.go index 5f3435c..e939427 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -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]) diff --git a/cmd/backup/show_config.go b/cmd/backup/print_config.go similarity index 98% rename from cmd/backup/show_config.go rename to cmd/backup/print_config.go index 51720f1..2deaf4d 100644 --- a/cmd/backup/show_config.go +++ b/cmd/backup/print_config.go @@ -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 diff --git a/docs/how-tos/show-configuration.md b/docs/how-tos/print-configuration.md similarity index 80% rename from docs/how-tos/show-configuration.md rename to docs/how-tos/print-configuration.md index 82775a4..09f284a 100644 --- a/docs/how-tos/show-configuration.md +++ b/docs/how-tos/print-configuration.md @@ -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 backup show-config +docker exec 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:// backup show-config +docker exec -e BACKUP_SOURCES=/backup -e NOTIFICATION_URLS=stdout:// backup print-config ``` Note: output includes secrets exactly as loaded. diff --git a/docs/reference/index.md b/docs/reference/index.md index 027ed0b..0974123 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -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 %} ``` diff --git a/test/show-config/conf.d/01show-config.env b/test/print-config/conf.d/01print-config.env similarity index 100% rename from test/show-config/conf.d/01show-config.env rename to test/print-config/conf.d/01print-config.env diff --git a/test/show-config/docker-compose.confd.yml b/test/print-config/docker-compose.confd.yml similarity index 100% rename from test/show-config/docker-compose.confd.yml rename to test/print-config/docker-compose.confd.yml diff --git a/test/show-config/docker-compose.yml b/test/print-config/docker-compose.yml similarity index 100% rename from test/show-config/docker-compose.yml rename to test/print-config/docker-compose.yml diff --git a/test/show-config/run.sh b/test/print-config/run.sh similarity index 87% rename from test/show-config/run.sh rename to test/print-config/run.sh index 5979f7b..0f822c0 100755 --- a/test/show-config/run.sh +++ b/test/print-config/run.sh @@ -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."