From abc233a90250e984fac6a1a9ef06bda259c73392 Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Fri, 14 Jun 2024 15:13:02 +0300 Subject: [PATCH] lib/backup/s3remote: fixed credsFilePath flag (#6488) properly use credsFilePath flag value https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6353 --------- Signed-off-by: hagen1778 Co-authored-by: hagen1778 (cherry picked from commit e678a9aa5195e5d00a882bf8377983c5acf10496) --- docs/CHANGELOG.md | 1 + lib/backup/s3remote/s3.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2d665ba55..785fdae1f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -42,6 +42,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/). * BUGFIX: [vmctl](https://docs.victoriametrics.com/vmctl/): add `--disable-progress-bar` global command-line flag. It can be used for disabling dynamic progress bar for all migration modes. `--vm-disable-progress-bar` command-line flag is deprecated and will be removed in the future releases. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6367). * BUGFIX: [stream aggregation](https://docs.victoriametrics.com/stream-aggregation/): prevent [rate_sum](https://docs.victoriametrics.com/stream-aggregation/#rate_sum) and [rate_avg](https://docs.victoriametrics.com/stream-aggregation/#rate_avg) producing `NaN` results for stale time series. Before, when series matched for aggregation became stale or weren't updated during aggregation interval, the `rate_sum` or `rate_avg` could produce data point with `NaN` value. During visualization, such aggregation results would be displayed as gaps in time series. * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert/): fix path for system links printed on default vmalert's UI page when `-http.pathPrefix` is set. +* BUGFIX: [vmbackup](https://docs.victoriametrics.com/vmbackup/): properly configure authentication when `-configFilePath` cmd-line flag is specified. ## [v1.102.0-rc1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.102.0-rc1) diff --git a/lib/backup/s3remote/s3.go b/lib/backup/s3remote/s3.go index 173009c87..9625e5235 100644 --- a/lib/backup/s3remote/s3.go +++ b/lib/backup/s3remote/s3.go @@ -99,9 +99,14 @@ func (fs *FS) Init() error { config.WithDefaultRegion("us-east-1"), } - if len(fs.CredsFilePath) > 0 { + if len(fs.ConfigFilePath) > 0 { configOpts = append(configOpts, config.WithSharedConfigFiles([]string{ fs.ConfigFilePath, + })) + } + + if len(fs.CredsFilePath) > 0 { + configOpts = append(configOpts, config.WithSharedCredentialsFiles([]string{ fs.CredsFilePath, })) }