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

Validate and modify agent commands #244

Merged
merged 5 commits into from
Jun 30, 2023
Merged

Conversation

pablochacin
Copy link
Collaborator

@pablochacin pablochacin commented Jun 29, 2023

Description

This generalizes the mechanism of the pod visitor used by the agent controller to generate a command for each pod.
This generalization requires the controller to use a list of pods as its target (instead of a list of pod names) and pass it to the visitor. The visitor was also modified to allow returning an error if it cannot generate a command for the target.

These two changes allow the visitor to check conditions in the target (for example, that it exposes the target port) and to customize the command to the pod.

Fixes #217

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 e2e test locally (make e2e-xxx for agent, disruptors, kubernetes 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>
@pablochacin pablochacin changed the title Validate modify agent commands Validate and modify agent commands Jun 29, 2023
@pablochacin pablochacin marked this pull request as ready for review June 29, 2023 17:22
@pablochacin pablochacin requested a review from roobre June 29, 2023 17:22
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Copy link
Member

@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 great, I really like the new approach with the visit function 😗👌

Left two suggestions re. naming.

pkg/disruptors/controller.go Outdated Show resolved Hide resolved
pkg/utils/kubernetes.go Outdated Show resolved Hide resolved
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Copy link
Member

@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, thanks for tackling this!

@pablochacin pablochacin requested a review from roobre June 30, 2023 10:15
@pablochacin pablochacin merged commit 37a830b into main Jun 30, 2023
@pablochacin pablochacin deleted the validate-modify-agent-commands branch June 30, 2023 13:17
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.

Implement a validation/customization mechanism fault injection on each target pod
2 participants