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

Provide flags to disable non plugin related operations #682

Closed
leodotcloud opened this issue Apr 17, 2019 · 3 comments
Closed

Provide flags to disable non plugin related operations #682

leodotcloud opened this issue Apr 17, 2019 · 3 comments
Assignees
Milestone

Comments

@leodotcloud
Copy link

Describe the solution you'd like
When using sonobuoy with a plugin, (https://github.com/heptio/sonobuoy/blob/master/pkg/discovery/discovery.go#L111) there is no need to run the other steps in this function. Like there is no need to run the queries in different namespaces. Having flags like --disable-queries might be useful to avoid breaking usage.

If this is an acceptable thing, I can quickly make a PR with the changes.

@johnSchnake
Copy link
Contributor

Hi @leodotcloud ,

A few thoughts:

  • I agree that disabling queries should be easier than it currently is in case you really don't want that data

when using sonobuoy with a plugin ... there is no need to run the other steps...

  • I disagree on that point. Sometimes we are only curious in the plugin results itself, but often when the plugin may report an error it won't have enough message to diagnose the problem itself. It helps to have the extra data to describe the state of the cluster.

  • There a few tickets (Allow ordered operations via plugin order #627 Queries should use dynamic client #630 Extract queries to their own plugin #432 ) related to the queries but they just didn't make it into this milestone. It seems like you'd agree with the end goal: queries shouldn't be the job of sonobuoy directly. The eventual goal is to get queries into their own plugin. In order do that we also wanted to continue to ensure they were run at the end of the run (it helps diagnose leaked resources from plugins for instance) so it is blocked by Allow ordered operations via plugin order #627

  • There are ways to drastically reduce what queries happen but they are not clear to most users. Changing the namespace filter for the queries to a non-existent namespace would lead to no data (other than the heptio-sonobuoy one) or updating the Resources field of config.json to be empty would do the same thing. Though, in both of those cases, you still query the heptio-sonobuoy namespace.

All that being said we (1) want to make things easier for users and (2) even though we intend for queries to go to their own plugin which could be skipped entirely I have no idea of how priorities will shift. I think that a flag/field for skipping the query logic would be appropriate.

Tag me in the PR and thanks for the contribution!

@johnSchnake
Copy link
Contributor

I'm considering nixing this in light of some discussion about what functionality already exists. The idea is that we should be able to just stop the queries almost completely by just setting Resources to the empty slice.

However I just found a bug that was causing this to not be the case. After that goes it, it seems like it is just about making it more well known how to tweak query options. I'm open to expanding that, but I don't think the flag is strictly necessary then.

Will update again once that goes in with a more clear example and caveats about it.

@johnSchnake johnSchnake self-assigned this May 17, 2019
@johnSchnake
Copy link
Contributor

With the fixes that went in this is fairly easy, just needing to provide the empty (non-nil) resources config setting. The only thing that is gathered are the logs for the namespace sonobuoy was in which is helpful for understanding many results anyways.

$ sonobuoy gen config|jq '.Resources=[]'|jq '.WorkerImage="gcr.io/heptio-images/sonobuoy:master"'>noquery.conf
$ sonobuoy run --mode=quick --config=noquery.conf --wait

Note: the worker image has to be set here because this is on master right now (and I just pushed a publish master image) but not on the last "released" version.

You could also use echo to create the config file:

echo '{"Resources":[], "WorkerImage":"gcr.io/heptio-images/sonobuoy:master"}' > noquery.conf

For now I'm going to close this since there is an existing workaround. If you feel strongly that you still want these log queries removed as well then we can continue the discussion.

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

No branches or pull requests

2 participants