From c0a52bcfca4dad0e9c734d08fa7650ff2fcab780 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Wed, 25 Oct 2023 07:38:46 -0400 Subject: [PATCH] remote.vault: respect value of `namespace` argument (#5582) Unfortunately, this setting can't be easily tested because Vault namespaces are an enterprise-only feature. Co-authored-by: Paschalis Tsilias --- CHANGELOG.md | 10 ++++++---- component/remote/vault/vault.go | 10 +++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdfe8c15d0c1..e9e10e3953c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ Main (unreleased) ### Features -- Added a new `stage.decolorize` stage to `loki.process` component which +- Added a new `stage.decolorize` stage to `loki.process` component which allows to strip ANSI color codes from the log lines. (@thampiotr) - Added a new `stage.sampling` stage to `loki.process` component which @@ -45,7 +45,7 @@ Main (unreleased) ### Bugfixes -- Fixed an issue where `loki.process` validation for stage `metric.counter` was +- Fixed an issue where `loki.process` validation for stage `metric.counter` was allowing invalid combination of configuration options. (@thampiotr) - Fixed issue where adding a module after initial start, that failed to load then subsequently resolving the issue would cause the module to @@ -60,9 +60,11 @@ Main (unreleased) - Fixed an issue where native histogram time series were being dropped silently. (@krajorama) -- Fix an issue with static mode and `promtail` converters, where static targets +- Fix an issue with static mode and `promtail` converters, where static targets did not correctly default to `localhost` when not provided. (@thampiotr) +- Fix an issue where `remote.vault` ignored the `namespace` argument. (@rfratto) + - Fix validation issue with ServiceMonitors when scrape timeout is greater than interval. (@captncraig) - Static mode's spanmetrics processor will now prune histograms when the dimension cache is pruned. @@ -98,7 +100,7 @@ v0.37.2 (2023-10-16) config not being included in the river output. (@erikbaranowski) - Fix issue with default values in `discovery.nomad`. (@marctc) - + ### Enhancements - Update Prometheus dependency to v2.47.2. (@tpaschalis) diff --git a/component/remote/vault/vault.go b/component/remote/vault/vault.go index 5b8e347cde66..24163b1c4f00 100644 --- a/component/remote/vault/vault.go +++ b/component/remote/vault/vault.go @@ -65,7 +65,15 @@ func (a *Arguments) client() (*vault.Client, error) { cfg.MaxRetries = a.ClientOptions.MaxRetries cfg.Timeout = a.ClientOptions.Timeout - return vault.NewClient(cfg) + cli, err := vault.NewClient(cfg) + if err != nil { + return cli, err + } + + if a.Namespace != "" { + cli.SetNamespace(a.Namespace) + } + return cli, nil } // SetToDefault implements river.Defaulter.