Filebeat config/TestReadConfig2

I'm new to the beats codebase and am wondering whether test TestReadConfig2 in filebeat/config is working as intended. Namely, it seems that cfgfile.Read() on line 23 isn't working correctly. A println reveals that config is unpacked to "zero" values, with an empty Prospectors list. Similarly, if I make a small edit to the yml file and set spool size to 1 the test will still pass (and vice versa). It seems that the way to fix this is to change line 20 config := &Config{} to config := &struct{ Filebeat Config}{}. It's not super clear to me why exactly this wrapper is necessary -- would appreciate if someone could explain the reason for this and the relevant part of the unpacking code. Let me know if I should add this to the github issue tracker.

This is based on commit f3f55c4ef8d99ad620f0882f8b55c0caf1d40795 in the master branch.

I commented on the issue here: https://github.com/elastic/beats/issues/2309

This topic was automatically closed after 21 days. New replies are no longer allowed.