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

fix to generate storage local path using usage #1438

Merged
merged 2 commits into from
Jan 30, 2017

Conversation

tagomoris
Copy link
Member

This feature is very useful for plugins which uses 2 or more storage instances, with root_dir configuration.

@tagomoris tagomoris added enhancement Feature request or improve operations v0.14 labels Jan 30, 2017
@tagomoris tagomoris self-assigned this Jan 30, 2017
@tagomoris
Copy link
Member Author

@repeatedly could you review this change?

@@ -64,7 +64,8 @@ def configure(conf)
end
end
elsif root_dir = owner.plugin_root_dir
@path = File.join(root_dir, 'storage.json')
basename = (conf.arg && !conf.arg.empty?) ? "storage.#{conf.arg}.json" : "storage.json"
Copy link
Member

Choose a reason for hiding this comment

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

conf.arg can contain space like <storage foo bar>.
So need to validate or convert unexpected charactors.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I'll add validation for usage.

Copy link
Contributor

Choose a reason for hiding this comment

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

This conf.arg will be given by :usage in storage_create?
Or users should specify <storage args> by themselves?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I got it.
We should fill up usage when conf is Fluent::Config::Element's instance case: https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/storage.rb#L56

Copy link
Contributor

Choose a reason for hiding this comment

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

This behavior is a limitations for now.

@repeatedly
Copy link
Member

One comment. Others are good.

@tagomoris
Copy link
Member Author

Pushed a commit to add validation for usage.

@tagomoris tagomoris merged commit 59ab3e6 into master Jan 30, 2017
@tagomoris tagomoris deleted the local-storage-path-using-usage branch January 30, 2017 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations v0.14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants