-
Notifications
You must be signed in to change notification settings - Fork 238
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
Refactor mimir.rules.kubernetes component (port from agent repo) #158
Conversation
This change refactors the `mimir.rules.kubernetes` component to move most mutable state into a separate `eventProcessor` struct. The existing code already split most behavior between the main `rules.go` file and `events.go` file. This takes the next logical step and wraps the state from `events.go` into its own struct. This is a prerequisite for a future PR that will add clustering support to the `mimir.rules.kubernetes` component. In the future PR a particular agent instance will be the "leader" for syncing rules from Mimir or not. When not the leader, the `eventProcesor` will be a no-op. Signed-off-by: Nick Pillitteri <[email protected]>
Signed-off-by: Nick Pillitteri <[email protected]>
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 added a few comments, but I'm happy for it to be merged as it is.
@56quarters Paulin left a few comments on your changes. I will let you decide how you want to handle these |
I'll take a look and push some changes, thanks! |
Signed-off-by: Nick Pillitteri <[email protected]>
Signed-off-by: Nick Pillitteri <[email protected]>
I've made a few of the changes and provided an explanation for others. Can the Alloy team take another look at this PR? |
…fana#158) * Refactor mimir.rules.kubernetes component This change refactors the `mimir.rules.kubernetes` component to move most mutable state into a separate `eventProcessor` struct. The existing code already split most behavior between the main `rules.go` file and `events.go` file. This takes the next logical step and wraps the state from `events.go` into its own struct. This is a prerequisite for a future PR that will add clustering support to the `mimir.rules.kubernetes` component. In the future PR a particular agent instance will be the "leader" for syncing rules from Mimir or not. When not the leader, the `eventProcesor` will be a no-op. Signed-off-by: Nick Pillitteri <[email protected]> --------- Signed-off-by: Nick Pillitteri <[email protected]> Co-authored-by: Nick Pillitteri <[email protected]>
I'm moving this PR to this repo