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

Refactor agent controller #355

Merged
merged 9 commits into from
Oct 19, 2023
Merged

Refactor agent controller #355

merged 9 commits into from
Oct 19, 2023

Conversation

pablochacin
Copy link
Collaborator

@pablochacin pablochacin commented Oct 17, 2023

Description

Refactor the code around the AgentController to improve the separation of concerns and facilitate testing by separating the logic that handles the management of a set of pods (PodController) from the logic that interacts with one agent (PodVisitor).

Also simplifies the API around the generation of the commands used for interacting with the pod agent.

Fixes: #259

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make test) and all tests pass.
  • I have run relevant integration test locally (make integration-xxx for affected packages)
  • I have run relevant e2e test locally (make e2e-xxx for disruptors, or cluster related changes)
  • Any dependent changes have been merged and published in downstream modules

Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@pablochacin pablochacin marked this pull request as ready for review October 17, 2023 12:58
Copy link
Collaborator

@roobre roobre left a comment

Choose a reason for hiding this comment

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

I'm really liking these changes, the code feels much more natural now. Awesome work!

I left some comments, mostly related to docstrings and a few regarding naming. LMK what you think!

pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/disruptors/pod.go Outdated Show resolved Hide resolved
pkg/disruptors/controller_test.go Outdated Show resolved Hide resolved
pkg/disruptors/controller_test.go Outdated Show resolved Hide resolved
pkg/disruptors/pod_test.go Outdated Show resolved Hide resolved
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Copy link
Collaborator

@roobre roobre left a comment

Choose a reason for hiding this comment

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

Looking awesome to me!

@pablochacin pablochacin merged commit b5d3813 into main Oct 19, 2023
8 checks passed
@pablochacin pablochacin deleted the refactor-agent-controller branch October 19, 2023 09:39
@pablochacin pablochacin mentioned this pull request Oct 30, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve decoupling between Disruptors, AgentController and Selector
2 participants