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

Skogul should error when no defined handlers #200

Open
sklirg opened this issue Nov 22, 2021 · 1 comment
Open

Skogul should error when no defined handlers #200

sklirg opened this issue Nov 22, 2021 · 1 comment
Labels
core/config Anything dealing with the configuration subsystem receiver Receiver-related

Comments

@sklirg
Copy link
Member

sklirg commented Nov 22, 2021

There is no check for if a receiver has a defined handler during configuration parsing. This is also made more complex by the fact that handlers might have different key names and/or structures depending on the receiver (i.e. handlers: map[string]string for HTTP receiver and handler: string for others).

We should have a check in the configuration parsing/applying which stops skogul if it is missing a handler for a receiver.

When a receiver receives data with no handler, skogul panics because of a nil handler. So currently, this behaviour is not seen before skogul receives some data.

@sklirg sklirg added the core/config Anything dealing with the configuration subsystem label Nov 22, 2021
@KristianLyng KristianLyng added the receiver Receiver-related label Dec 7, 2021
@KristianLyng
Copy link
Collaborator

I'd consider this a task for Verify() for each individual receiver, but maybe we want to modify the Receiver interface to enforce a HasHandler() check? Since Verify is, and should remain, an optional interface, and there's no generic way of testing this for the reasons you mentioned. Enforcing it through the interface would make it hard/impossible to forget to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/config Anything dealing with the configuration subsystem receiver Receiver-related
Projects
None yet
Development

No branches or pull requests

2 participants