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

Reload Botkube on remote config change #1006

Merged
merged 8 commits into from
Mar 10, 2023
Merged

Conversation

pkosiec
Copy link
Member

@pkosiec pkosiec commented Mar 6, 2023

Description

Changes proposed in this pull request:

  • Reload Botkube on remote config change

Limitations

As the TODO comment states, right now Botkube will reload on every config change:

	// TODO: check if notifications are enabled and if so:
	//  - update notifications for a given channel (this needs a global state)
	//  - send message to a given channel (this needs a rework for the notifier executor)
	//    - updating notifications should happen after ConfigMap update, not before
	//    - same for remote config reloader
	//  - do not restart the app

This is something to address in future.

Follow-ups

@pkosiec pkosiec added the enhancement New feature or request label Mar 6, 2023
@pkosiec pkosiec force-pushed the watch-config branch 2 times, most recently from 45b6ee4 to 908879a Compare March 8, 2023 16:01
@pkosiec pkosiec marked this pull request as ready for review March 8, 2023 16:04
@pkosiec pkosiec requested review from a team and PrasadG193 as code owners March 8, 2023 16:04
@pkosiec pkosiec requested review from huseyinbabal and mszostok and removed request for huseyinbabal March 8, 2023 16:04
Copy link
Contributor

@mszostok mszostok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of you will end-up with conflicts 😄
#1007

internal/config/reloader/restarter.go Outdated Show resolved Hide resolved
internal/config/reloader/remote.go Outdated Show resolved Hide resolved
internal/config/reloader/remote.go Show resolved Hide resolved
cmd/botkube/main.go Show resolved Hide resolved
Copy link
Contributor

@mszostok mszostok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested e2e, works great 🚀

@pkosiec pkosiec merged commit 617c5c8 into kubeshop:main Mar 10, 2023
@pkosiec pkosiec deleted the watch-config branch March 10, 2023 10:45
Comment on lines -120 to -123
{{- if .Values.config.provider.endpoint }}
- name: CONFIG_PROVIDER_ENDPOINT
value: {{ .Values.config.provider.endpoint }}
{{- end }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey guys,
Nice job with this bot, really helpful 👍

I just saw the {{- if .Values.config.provider.endpoint }} was removed.
Any particular reason for it?
This is an old commit but this change is still on HEAD.

Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @joselcvarela 👋

I'm glad you like Botkube! 🚀

Regarding this change, while we could maintain it, we're currently using the default value here:https://github.com/kubeshop/botkube/blob/main/helm/botkube/values.yaml#L1228.

As long as you don't remove or override it, it should render properly.
However, this endpoint will only be utilized if the CONFIG_PROVIDER_IDENTIFIER is set; otherwise, it will be ignored, and the local configuration will be used. In such cases, no external calls are executed. You can find the code responsible for this here.

Did you encounter any problems with it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your response.
No, I haven't seen any issue so far.
I was just looking through the values passed to templates, and this part was intriguing me 👍
Keep on with the good job 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants