Feature: merge multiple "--config" and "--config-directory" flags#9007
Feature: merge multiple "--config" and "--config-directory" flags#9007sspaink merged 5 commits intoinfluxdata:masterfrom
Conversation
…using multiple --config or --config-directory flags
srebhan
left a comment
There was a problem hiding this comment.
While the code looks good to me, you have to fix the CI errors for the windows build before this has a chance to be merged. The error is
# github.com/influxdata/telegraf/cmd/telegraf
cmd\telegraf\telegraf_windows.go:87:7: undefined: fConfig
cmd\telegraf\telegraf_windows.go:88:48: undefined: fConfig
cmd\telegraf\telegraf_windows.go:90:7: undefined: fConfigDirectory
cmd\telegraf\telegraf_windows.go:91:77: undefined: fConfigDirectory
|
And |
|
Sorry about that, I figured it was quicker to just fix it rather than reply. Thanks for reviewing this. |
|
!retry-failed |
1 similar comment
|
!retry-failed |
|
Since, |
|
@Hipska well imagine a case where you have one central (directory) repository that defines the "used-everywhere" plugins and then a machine-local directory for holding the machine-individual configs. Those will likely not be nested. We currently approximate such a use case with symbolic links in one "machine-local" directory but it's... a workaround. :-) |
|
Both of these directories can be put in a parent directory and that one will be parsed recursively, so I still see no actual use case. It seems better to KISS as much as possible. |
|
@Hipska let me put an example. The central repository is located on a server and mounted e.g. to |
|
@Hipska Going through a directory recursively doesn't allow you to fetch and merge multiple config files over http. |
@srebhan symlink would indeed be better. I would avoid adding 'complex' logic on the command line arguments.
@gdunstone Correct, that's why I have absolutely no objection towards multiple |
|
@Hipska I am ambivalent about the However I can see the use case @srebhan provides. |
|
@Hipska I still don't see the complex logic point, but to cut a long story short: I can live with only one config directory option even though I'd prefer multiple ones. ;-) |
|
And I prefer not 😂 Best would be someone from Influx to give their thoughts. If you want to include multiple different directories, I think it would be better to make that an option in the toml config rather than on the command line. |
|
The only difference is: Now only you is happy, with the change we can both be happy as nobody forces you to use the option multiple times. |
|
You are right 😛 But maybe put it on the table for the weekly meeting to know their view on it? |
|
I'm okay with multiple --config and multiple --config-directory flags. It adds flexibility but doesn't harm the users who are not using it. This is good to go once my comment is resolved. |
This adds a feature mentioned in this issue #7501
The only change in functionality is that telegraf will now merge multiple "--config" and "--config-directory" flags into the config, rather than only using value of the last flag.
Required for all PRs: