-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Controller clean up #25579
Controller clean up #25579
Conversation
/test |
Hey, are you aware of |
@joamaki Was not aware of |
2cb0893
to
8240fc9
Compare
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.
Just a nit left inline. Nice cleanup, thanks! 💯
pkg/controller/manager.go
Outdated
) | ||
|
||
var ( | ||
// globalStatus is the global status of all controllers | ||
globalStatus = NewManager() | ||
) | ||
|
||
type controllerMap map[string]*Controller | ||
type managedController 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.
Nit: I think it's better to move unexported types to the bottom, after the exported ones, in order to improve readability for the package users.
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.
Fixed, thanks!
Current CI failures should be solved simply rebasing. |
Simplify controller goroutine implementation by using an infinite interval instead of a series of 10 minute intervals when the controller function does not need to run. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Make the contract between the manager and a controller more explicit by documenting it in controller struct definition. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
ControllerParams is passed by value, so it is possible to add cancel to the given context, to define it if nil. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Pass ControllerParameter updates in the update channel to simplify code. We already have the channel for update notifications, migth as well use it to pass the updated parameters to simplify synchronization between the manager and the controller. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
…ntract Move controller fields only accessed by the manager to a new 'managedController' type. This hides these fields from the 'controller' type making documentation easier. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
TerminationChannel function was only used for testing, move it to test file. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com> info: patch template saved to `-`
Controller type need not be exported. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
8240fc9
to
3124bda
Compare
Rebased for CI fixes. |
/test |
Clean up internals of
pkg/controller
by: