Skip to content
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

Fixes possible panic in json pipeline stage. #1894

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

cyriltovena
Copy link
Contributor

This was reported to me today and it happens because the previous source can be nil.
This was only happening when debug log was on. And the problem was only in the json because it was using .String on a nil value.

I've added a test and activate debug during tests to cover those path too.

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

This was reported to me today and it happens because the previous source can be nil.
This was only happening when debug log was on. And the problem was only in the json because it was using .String on a nil value.

I've added a test and activate debug during tests to cover those path too.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #1894 into master will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1894      +/-   ##
==========================================
- Coverage   64.67%   64.61%   -0.06%     
==========================================
  Files         125      125              
  Lines        9477     9477              
==========================================
- Hits         6129     6124       -5     
- Misses       2924     2926       +2     
- Partials      424      427       +3     
Impacted Files Coverage Δ
pkg/logentry/stages/json.go 75.30% <100.00%> (+4.93%) ⬆️
pkg/promtail/targets/tailer.go 73.86% <0.00%> (-4.55%) ⬇️
pkg/promtail/targets/filetarget.go 68.71% <0.00%> (-1.85%) ⬇️
pkg/logql/evaluator.go 90.69% <0.00%> (-0.59%) ⬇️

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@owen-d owen-d merged commit a252a8f into grafana:master Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants