-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add plugin manager for sources #857
Conversation
3ad94b1
to
4695584
Compare
d1a7f8a
to
aefe8fb
Compare
aefe8fb
to
0da015a
Compare
@@ -1,4 +1,4 @@ | |||
package e2e | |||
package fake |
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.
I cannot put the fake
pkg inside e2e
as then logs streaming for test doesn't work because of this issue: golang/go#46959
9bf7ab8
to
92da379
Compare
92da379
to
fb20fdc
Compare
> **Note** | ||
> If Botkube runs inside the k3d cluster, export the `PLUGIN_SERVER_HOST=http://host.k3d.internal` environment variable. | ||
|
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.
> **Note** | |
> If Botkube runs inside the k3d cluster, export the `PLUGIN_SERVER_HOST=http://host.k3d.internal` environment variable. | |
> **Note** | |
> If Botkube runs inside the k3d cluster, export the `PLUGIN_SERVER_HOST=http://host.k3d.internal` environment variable. | |
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.
lgtm 👍
) | ||
|
||
// CMWatcher implements Botkube source plugin. | ||
type CMWatcher struct{} |
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.
Code style consistency - type
block above combined with single line declaration.
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.
Actually, I use the type
block to "group" related entities, so the code block above is about types related to the configuration. This one is about the "service" that implements the source plugin functionality, so it's close to its methods.
Are you OK with such approach?
internal/source/source.go
Outdated
// As a result our key is e.g. ['source-name1;source-name2'] | ||
startProcesses := map[string]struct{}{} | ||
|
||
startPlugin := func(bindSources []string) error { |
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.
Isn't this function complex enough to be named / defined separately?
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.
yes, you are right. I changed it to become a dedicated method on this struct 👍
In the next PR, I will change it even more to make it more straight forward when it comes to the responsibilities. Because I see that it is to complex to maintain and test all those pieces together.
Hi @josefkarasek! Thanks for your review 🙇 |
Description
Changes proposed in this pull request:
Related issue(s)