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

Fileglob parsing fixes #1485

Merged
merged 3 commits into from
Jan 13, 2020
Merged

Fileglob parsing fixes #1485

merged 3 commits into from
Jan 13, 2020

Conversation

p37ruh4
Copy link
Contributor

@p37ruh4 p37ruh4 commented Jan 8, 2020

What this PR does / why we need it:
Updated doulbestar module to version 1.2.2 which contains fix for Glob parsing, please see this issue for details: bmatcuk/doublestar#25

Which issue(s) this PR fixes:
Fixes #1314

Special notes for your reviewer:
I've also rewritten how absolute path is set in filetarget.go as it was not expecting that more than one path can be specified.

Checklist

  • Documentation added
  • Tests updated

@p37ruh4
Copy link
Contributor Author

p37ruh4 commented Jan 10, 2020

Any comments on this?

// Gets current list of files to tail.
matches, err := doublestar.Glob(path)
matches, err := doublestar.Glob(t.path)
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems that before we were passing an abs path ? but not anymore ? I was hoping @slim-bean would have more time to review this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cyriltovena, absolute path is is added in for loop below: https://github.com/grafana/loki/pull/1485/files#diff-f449cd9f72b80900843b80037638cbd7R205

Previously code was assuming that only one path will be specified, now it checks if that is absolute path, and if it is not, it replaces each match with absolute path.

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@cyriltovena cyriltovena merged commit 4f314f3 into grafana:master Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

promtail: __path__ fileglob behavior
2 participants