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

Raise config error when using same file path in file_signle buffer #2600

Merged
merged 1 commit into from
Sep 4, 2019

Conversation

ganmacs
Copy link
Member

@ganmacs ganmacs commented Sep 3, 2019

Which issue(s) this PR fixes:
none

What this PR does / why we need it:
if user passes /path/to/foo.*.baz to single file buffer plugin as path
directive, single file buffer convert it into /path/to/fsb.*.buf.
in here.

new_path = File.join(File.dirname(@path), "fsb.*#{PATH_SUFFIX}")
log.warn "file_single doesn't allow user specified 'prefix.*.suffix' style path. Use '#{new_path}' for file instead: #{@path}"
@path = new_path

When the user uses another single file buffer whose path is /path/to/ in the above situation, single file buffer should raise anConfigError, but not in present implementation.

Docs Changes:

no need

Release Note:

same as the title

if user passes `/path/to/foo.*.baz` to buffer plugin A  as `path`
directive, single file buffer convert it into `/path/to/fsb.*.buf`.
in https://github.com/fluent/fluentd/blob/c7a825c7cad52f0c2a322ae88f7011e842b3d4fb/lib/fluent/plugin/buf_file_single.rb#L115-L117

Signed-off-by: Yuta Iwama <[email protected]>
@ganmacs ganmacs added the bug Something isn't working label Sep 3, 2019
Copy link
Member

@repeatedly repeatedly left a comment

Choose a reason for hiding this comment

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

Good catch!
After travis-ci finished, please merge :)

@ganmacs ganmacs merged commit 33b94e6 into fluent:master Sep 4, 2019
@ganmacs ganmacs deleted the fix-file-checkbug branch September 4, 2019 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants