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

[addon-operator] add module reregister #432

Merged
merged 4 commits into from
Jan 12, 2024

Conversation

miklezzzz
Copy link
Contributor

@miklezzzz miklezzzz commented Dec 6, 2023

Overview

Changes:
A lot of changes related to starting/restarting/disabling a module without restarting addon-operator.

What this PR does / why we need it

With this PR we can provide a way of reloading (restarting its life cycle like disabling and deregistering its hooks, reloading its configuration and re-run the module) a single module without restarting addon-operator.

Special notes for your reviewer

@miklezzzz miklezzzz self-assigned this Dec 6, 2023
@miklezzzz miklezzzz added the enhancement New feature or request label Dec 6, 2023
@miklezzzz miklezzzz force-pushed the add-register-and-load-single-module branch 26 times, most recently from 20330ce to a24a155 Compare December 13, 2023 08:12
@miklezzzz miklezzzz marked this pull request as ready for review December 13, 2023 09:42
@miklezzzz miklezzzz force-pushed the add-register-and-load-single-module branch 6 times, most recently from a38c103 to bd87d5e Compare December 19, 2023 12:35
@miklezzzz miklezzzz marked this pull request as draft December 19, 2023 14:32
@miklezzzz miklezzzz force-pushed the add-register-and-load-single-module branch 5 times, most recently from 49657ca to f2d803a Compare December 20, 2023 14:33
@miklezzzz miklezzzz marked this pull request as ready for review December 20, 2023 14:37
@miklezzzz miklezzzz force-pushed the add-register-and-load-single-module branch 2 times, most recently from b2328ac to d558146 Compare December 20, 2023 19:14
@miklezzzz miklezzzz marked this pull request as draft December 20, 2023 19:18
@miklezzzz miklezzzz force-pushed the add-register-and-load-single-module branch 2 times, most recently from 474d7d1 to ed207d9 Compare December 20, 2023 19:51
@miklezzzz miklezzzz marked this pull request as ready for review December 20, 2023 20:29
return false
}

return *moduleConfig.IsEnabled
Copy link
Contributor

Choose a reason for hiding this comment

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

IsEnabled could be nil. We have to add a check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -108,6 +117,24 @@ func (kcm *KubeConfigManager) KubeConfigEventCh() chan config.KubeConfigEvent {
return kcm.configEventCh
}

// UpdateModuleConfig updates a single module config
func (kcm *KubeConfigManager) UpdateModuleConfig(moduleName string) error {
newConfig, err := kcm.backend.LoadConfig(kcm.ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have to add variadic parameter moduleName ...string to the LoadConfig function, to have ability to reload only desired ModuleConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Mikhail Scherba <[email protected]>
Signed-off-by: Mikhail Scherba <[email protected]>
Signed-off-by: Mikhail Scherba <[email protected]>
@miklezzzz miklezzzz force-pushed the add-register-and-load-single-module branch from ed207d9 to 74fdf90 Compare December 29, 2023 15:02
@miklezzzz miklezzzz requested a review from yalosev December 29, 2023 15:40
@yalosev yalosev merged commit e464020 into main Jan 12, 2024
8 checks passed
@yalosev yalosev deleted the add-register-and-load-single-module branch January 12, 2024 11:19
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.

2 participants