diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-02-16 07:28:48 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-02-16 07:28:48 +0300 |
commit | a222a2c882fb91be255731fdbe6c74bc9a697ed5 (patch) | |
tree | 5723278ed6a4131848246d8eeee02f96e4ead26f /cmd | |
parent | d4daa7a154ccc86d1b57372e4265bb502c886537 (diff) | |
parent | 32df8568651ca1cb9f0885532bb744623c8de325 (diff) |
Merge branch 'backup_gitaly_servers_env' into 'master'
gitaly-backup: Allow using env GITALY_SERVERS to setup gitaly connection info
See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5384
Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Approved-by: Justin Tobler <jtobler@gitlab.com>
Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Reviewed-by: James Fargher <proglottis@gmail.com>
Reviewed-by: Quang-Minh Nguyen <qmnguyen@gitlab.com>
Reviewed-by: Justin Tobler <jtobler@gitlab.com>
Co-authored-by: James Fargher <jfargher@gitlab.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gitaly-backup/main.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/gitaly-backup/main.go b/cmd/gitaly-backup/main.go index 808c67a3a..eed6a6d63 100644 --- a/cmd/gitaly-backup/main.go +++ b/cmd/gitaly-backup/main.go @@ -6,6 +6,7 @@ import ( "io" "os" + "gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/storage" "gitlab.com/gitlab-org/gitaly/v15/internal/log" ) @@ -41,7 +42,12 @@ func main() { subcmd.Flags(subcmdFlags) _ = subcmdFlags.Parse(flags.Args()[2:]) - if err := subcmd.Run(context.Background(), os.Stdin, os.Stdout); err != nil { + ctx, err := storage.InjectGitalyServersEnv(context.Background()) + if err != nil { + logger.Fatalf("%s", err) + } + + if err := subcmd.Run(ctx, os.Stdin, os.Stdout); err != nil { logger.Fatalf("%s", err) } } |