Repository navigation
fix(thanos): correctly filter unsupported remote write fields - #8813
Merged
simonpasquier merged 1 commit intoSep 25, 2026
Conversation
| RoundRobinDNS: new(true), | ||
| }, | ||
| }, | ||
| golden: "v0.24.0_remote_write_config.golden", |
Contributor
There was a problem hiding this comment.
can we use a dedicated golden file?
Contributor
Author
There was a problem hiding this comment.
Thanks for the review, and apologies for the delayed response — I was occupied with my semester exams.
I've addressed this by adding a dedicated golden file for the regression test, as suggested. The production fix remains unchanged.
Thanks for pointing this out!
In createOrUpdateRulerConfigSecret, remote-write filtering iterated over tr.Spec.RemoteWrite by value, mutating a copy of each RemoteWriteSpec element rather than the element in the slice. As a result, unsupported remote-write fields remained in the generated configuration despite the operator logging that they were being ignored. Update the iteration to use pointer references to the slice elements so that unsupported fields are correctly cleared before generating the configuration. Signed-off-by: priyanshu7739410 <[email protected]>
priyanshu7739410
force-pushed
the
bug-hunt/thanos-ruler-rw-version-filtering
branch
from
September 23, 2026 11:56
183118a to
56ffa38
Compare
sdwilsh
pushed a commit
to sdwilsh/ansible-playbooks
that referenced
this pull request
Nov 7, 2026
…r to v0.95.1 (#2092) ##### [\`v0.95.1\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.95.1) Maintenance release because the CI workflow failed to publish the `v0.95.0` container images. --- ##### [\`v0.95.0\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.95.0) - \[CHANGE] Add `alertmanagerConfigFileSystemMode` field to the `Alertmanager` CRD controlling how to process `AlertmanagerConfig` resources which have references to files from the Alertmanager container's filesystem. - \[FEATURE] Add `extraScrapeMetrics` field to the `Prometheus` and `PrometheusAgent` CRDs. [#8810](prometheus-operator/prometheus-operator#8810) - \[FEATURE] Add `extraScrapeMetrics` field to the `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` CRDs. [#8892](prometheus-operator/prometheus-operator#8892) - \[FEATURE] Reconcile `ScrapeConfig` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8910](prometheus-operator/prometheus-operator#8910) - \[FEATURE] Reconcile `ServiceMonitor` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8860](prometheus-operator/prometheus-operator#8860) - \[FEATURE] Reconcile `PodMonitor` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8859](prometheus-operator/prometheus-operator#8859) - \[FEATURE] Reconcile `Probe` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8930](prometheus-operator/prometheus-operator#8930) - \[FEATURE] Reconcile `AlertmanagerConfig` status subresource on `Alertmanager` reconciliations (requires the `StatusForConfigurationResources` feature gate). [#8261](prometheus-operator/prometheus-operator#8261) - \[FEATURE] Add `labels` field to the `AlertmanagerConfig` to manage route labels. [#8761](prometheus-operator/prometheus-operator#8761) - \[FEATURE] Add support for route `labels` in the Alertmanager configuration Secret. [#8865](prometheus-operator/prometheus-operator#8865) - \[FEATURE] Add `botToken` support for the global Telegram configuration in the `Alertmanager` CRD. [#8403](prometheus-operator/prometheus-operator#8403) - \[ENHANCEMENT] Add distroless images (available under the `<version>-distroless` tag). [#8815](prometheus-operator/prometheus-operator#8815) - \[ENHANCEMENT] Add `--disable-pprof` CLI argument. [#8920](prometheus-operator/prometheus-operator#8920) - \[ENHANCEMENT] Configure the log level via the runtime configuration section instead of the `--log.level` flag for Prometheus >= `3.15.0`. [#8881](prometheus-operator/prometheus-operator#8881) - \[BUGFIX] Reject AlertmanagerConfig resources where PagerDuty `routingKey` and `serviceKey` references resolve to empty strings. [#8842](prometheus-operator/prometheus-operator#8842) - \[BUGFIX] Rollout Alertmanager pods when the cluster TLS configuration is updated. [#8840](prometheus-operator/prometheus-operator#8840) - \[BUGFIX] Pass `imagePullPolicy` to the `ThanosRuler` config-reloader sidecar. [#8916](prometheus-operator/prometheus-operator#8916) - \[BUGFIX] Make the ordering of the `ts` and `level` keys consistent in the config-reloader logs (the `ts` key always comes first). [#8913](prometheus-operator/prometheus-operator#8913) - \[BUGFIX] Reject MSTeamsV2 receivers without a webhook URL. [#8908](prometheus-operator/prometheus-operator#8908) - \[BUGFIX] Add credentials validation for Webex receivers in the `AlertmanagerConfig` CRD. [#8906](prometheus-operator/prometheus-operator#8906) [#8897](prometheus-operator/prometheus-operator#8897) - \[BUGFIX] Preserve HTTP client configuration for Azure SD in the `ScrapeConfig` CRD. [#8898](prometheus-operator/prometheus-operator#8898) - \[BUGFIX] Reject `AlertmanagerConfig` custom resources with duplicated time interval names. [#8896](prometheus-operator/prometheus-operator#8896) - \[BUGFIX] Improve validation for the PagerDuty receiver in the `AlertmanagerConfig` CRD. [#8842](prometheus-operator/prometheus-operator#8842) - \[BUGFIX] Add validation for the `clientAuthType` field in `Prometheus`, `PrometheusAgent`, `Alertmanager` and `ThanosRuler` CRDs. [#8823](prometheus-operator/prometheus-operator#8823) - \[BUGFIX] Discard unsupported fields in remote-write configuration for the `ThanosRuler` CRD. [#8813](prometheus-operator/prometheus-operator#8813) - \[BUGFIX] Add zone information to the generated kubelet EndpointSlice. [#8864](prometheus-operator/prometheus-operator#8864) - \[BUGFIX] Preserve the Pushover `ttl` field when converting `AlertmanagerConfig` resources. [#8866](prometheus-operator/prometheus-operator#8866) - \[BUGFIX] Handle unset email threading fields when converting `AlertmanagerConfig` resources. [#8858](prometheus-operator/prometheus-operator#8858) - \[BUGFIX] Add URL validation for the PagerDuty receiver in the Alertmanager configuration Secret. [#8221](prometheus-operator/prometheus-operator#8221) - \[BUGFIX] Add URL validation for the RocketChat receiver in the Alertmanager configuration Secret. [#8224](prometheus-operator/prometheus-operator#8224) - \[BUGFIX] Log errors when namespace flags conflict. [#8931](prometheus-operator/prometheus-operator#8931) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue where ThanosRuler remote-write version filtering could report unsupported fields as ignored without actually removing them from the generated remote-write configuration.
The filtering logic in
createOrUpdateRulerConfigSecretwas operating on a copy of eachRemoteWriteSpec(iterating withfor i, rw := range tr.Spec.RemoteWrite), so mutations torwonly modified the local copy — the original slice passed to configuration generation remained unchanged. As a result, unsupported fields (roundRobinDNS,sendNativeHistograms,messageVersion) stayed in the generated secret even though the operator logged that they would be ignored.This change updates the iteration to operate on the actual slice elements, so filtered fields are correctly cleared before the configuration is generated.
Closes #8812
Type of change
CHANGE(fix or feature that would cause existing functionality to not work as expected)FEATURE(non-breaking change which adds functionality)BUGFIX(non-breaking change which fixes an issue)ENHANCEMENT(non-breaking change which improves existing functionality)NONE(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
go test -run TestCreateOrUpdateRulerConfigSecret -v ./pkg/thanosgo test ./pkg/operator/...go test -run "TestRemoteWriteConfig" ./pkg/prometheusgo test ./pkg/thanos/...All relevant tests pass. Note that
pkg/thanos/statefulset_test.gohas 4 pre-existing test failures on Windows due to OS path separators (\vs/), which are also reproducible against the upstream baseline and are unrelated to this change.Changelog entry