-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(promtail): correctly parse list of drop stage sources from YAML #10848
Merged
MichelHollands
merged 6 commits into
grafana:main
from
rgroothuijsen:issue-10095-drop-stage-source-list
Oct 12, 2023
Merged
fix(promtail): correctly parse list of drop stage sources from YAML #10848
MichelHollands
merged 6 commits into
grafana:main
from
rgroothuijsen:issue-10095-drop-stage-source-list
Oct 12, 2023
Conversation
This file contains 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
@rgroothuijsen Thanks for this fix. Can you add an entry in the Promtail / Fixes section of CHANGELOG.md ? Once that is done I'll merge this. |
MichelHollands
approved these changes
Oct 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This was referenced Mar 25, 2024
This was referenced Apr 1, 2024
rhnasc
pushed a commit
to inloco/loki
that referenced
this pull request
Apr 12, 2024
…rafana#10848) **What this PR does / why we need it**: This PR fixes YAML parsing of the `source` field in the drop stage when said field is a list of strings. Because this list is not being recognized in the code as a list of strings, but rather as a list of generic `interface{}` elements, it fails a type check and throws an error. In order to fix this, an `interface{}` list is manually converted to a `string` list. The problem was already reproducible with existing tests, but the test YAML mistakenly referred to the field as `sources` rather than `source`. **Which issue(s) this PR fixes**: Fixes grafana#10095 **Special notes for your reviewer**: **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [ ] Documentation added - [x] Tests updated - [ ] `CHANGELOG.md` updated - [ ] If the change is worth mentioning in the release notes, add `add-to-release-notes` label - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/setup/upgrade/_index.md` - [ ] For Helm chart changes bump the Helm chart version in `production/helm/loki/Chart.yaml` and update `production/helm/loki/CHANGELOG.md` and `production/helm/loki/README.md`. [Example PR](grafana@d10549e) --------- Co-authored-by: Michel Hollands <[email protected]>
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.
What this PR does / why we need it:
This PR fixes YAML parsing of the
source
field in the drop stage when said field is a list of strings. Because this list is not being recognized in the code as a list of strings, but rather as a list of genericinterface{}
elements, it fails a type check and throws an error. In order to fix this, aninterface{}
list is manually converted to astring
list. The problem was already reproducible with existing tests, but the test YAML mistakenly referred to the field assources
rather thansource
.Which issue(s) this PR fixes:
Fixes #10095
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updatedadd-to-release-notes
labeldocs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PR