-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Migrate packetbeat config options to namespace #1490
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,11 +241,11 @@ func (sniffer *SnifferSetup) Datalink() layers.LinkType { | |
return layers.LinkTypeEthernet | ||
} | ||
|
||
func (sniffer *SnifferSetup) Init(test_mode bool, factory WorkerFactory) error { | ||
func (sniffer *SnifferSetup) Init(test_mode bool, factory WorkerFactory, interfaces *config.InterfacesConfig) error { | ||
var err error | ||
|
||
if !test_mode { | ||
err = sniffer.setFromConfig(&config.ConfigSingleton.Interfaces) | ||
err = sniffer.setFromConfig(interfaces) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha, the ConfigSingleton was only left in one place? Nice! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I remember last time I tried to remove all occurences it was not possible without major refactoring. It seems like the refactoring by Steffen did some magic here. |
||
if err != nil { | ||
return fmt.Errorf("Error creating sniffer: %v", err) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively this could have been written like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I wasn't aware that this would work.