From 9aaba5097e445c9958f5f640004e79239f0a9e47 Mon Sep 17 00:00:00 2001 From: sergey-arefev <99473084+sergey-arefev@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:28:03 +0200 Subject: [PATCH] Fix daemon client build ldflags values (#1504) * build walg-daemon-client: fix version * print walg-daemon-client version in test --- Makefile | 2 +- cmd/daemonclient/main.go | 2 +- docker/pg_tests/scripts/tests/daemon_client_test.sh | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 73445987e..dcd57b908 100644 --- a/Makefile +++ b/Makefile @@ -255,4 +255,4 @@ unlink_libsodium: build_client: cd cmd/daemonclient && \ - go build -o ../../bin/walg-daemon-client -ldflags "-s -w -X github.com/wal-g/wal-g/cmd/walg-daemon-client.buildDate=`date -u +%Y.%m.%d_%H:%M:%S` -X github.com/wal-g/wal-g/cmd/walg-daemon-client.gitRevision=`git rev-parse --short HEAD` -X github.com/wal-g/wal-g/cmd/walg-daemon-client.version=`git tag -l --points-at HEAD`" + go build -o ../../bin/walg-daemon-client -ldflags "-s -w -X main.buildDate=`date -u +%Y.%m.%d_%H:%M:%S` -X main.gitRevision=`git rev-parse --short HEAD` -X main.version=`git tag -l --points-at HEAD`" diff --git a/cmd/daemonclient/main.go b/cmd/daemonclient/main.go index e17f8734f..1feedc6aa 100644 --- a/cmd/daemonclient/main.go +++ b/cmd/daemonclient/main.go @@ -104,7 +104,7 @@ func main() { } if len(os.Args) > 1 && strings.ToLower(os.Args[1]) == "--version" { - fmt.Println(strings.Join([]string{version, gitRevision, buildDate}, "\t")) + fmt.Println(strings.Join([]string{"walg-daemon-client", version, gitRevision, buildDate}, "\t")) return } diff --git a/docker/pg_tests/scripts/tests/daemon_client_test.sh b/docker/pg_tests/scripts/tests/daemon_client_test.sh index abbdbd0cd..c8fd612bb 100755 --- a/docker/pg_tests/scripts/tests/daemon_client_test.sh +++ b/docker/pg_tests/scripts/tests/daemon_client_test.sh @@ -12,6 +12,9 @@ export SKIP_TEST_WAL_OVERWRITES="1" . /tmp/tests/test_functions/daemon_patch.sh . /tmp/tests/test_functions/daemon_client_patch.sh +# show client version +walg-daemon-client --version + prepare_config "/tmp/configs/full_backup_test_config.json" start_daemon test_full_backup "${TMP_CONFIG}"