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

Update plugin ordering to latest Sonobuoy version #1753

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

andrewyunt
Copy link
Contributor

What this PR does / why we need it:
Plugins should be able to run in a predetermined order. Adds order key to sonobuoy-config (lower number has a higher priority)

Which issue(s) this PR fixes

@andrewyunt andrewyunt force-pushed the orderedOp branch 6 times, most recently from 7b74436 to bf9a98d Compare July 1, 2022 19:35
logrus.WithField("plugin", p.GetName()).Info("Running plugin")
go aggr.RunAndMonitorPlugin(context.Background(), time.Duration(cfg.TimeoutSeconds)*time.Second, p, client, nodes.Items, cfg.AdvertiseAddress, certs[p.GetName()], aggregatorPod, progressPort, pluginResultsDir)
for _, pluginGroup := range getOrderedPlugins(plugins) {
var waitGroup sync.WaitGroup
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 to using a WaitGroup. As someone new to Go I'm really happy to see you explored the options and found this. It really simplifies the logic.

@andrewyunt andrewyunt force-pushed the orderedOp branch 4 times, most recently from 290c212 to fa312c1 Compare July 6, 2022 07:32
@johnSchnake johnSchnake changed the title WIP: Update plugin ordering to latest Sonobuoy version Update plugin ordering to latest Sonobuoy version Jul 6, 2022
Copy link
Contributor

@johnSchnake johnSchnake 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 testing this manually on my side too with some tweaks/nits/questions already made on the PR

pkg/plugin/aggregation/run.go Outdated Show resolved Hide resolved
@johnSchnake
Copy link
Contributor

I tried this out manually with a few cases and it worked great. Normal runs without order, worked. Edited one plugin to have order 99, launched one then the other. Modified both to have order 99, launched in parallel again.

We may tweak this logic over time, but I think having this basic order is great.

I already see us being able to use this and make query logic its own plugin and set its order to be high so that it gets run last. This will further simplify the core sonobuoy logic and maybe make it easier to customize too.

@johnSchnake johnSchnake merged commit c98e4ba into vmware-tanzu:main Jul 8, 2022
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.

Allow plugin ordering
2 participants