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

Sonobuoy CLI should allow specifying a directory of plugins #906

Closed
johnSchnake opened this issue Sep 25, 2019 · 2 comments · Fixed by #911
Closed

Sonobuoy CLI should allow specifying a directory of plugins #906

johnSchnake opened this issue Sep 25, 2019 · 2 comments · Fixed by #911
Assignees

Comments

@johnSchnake
Copy link
Contributor

Describe the solution you'd like
We currently allow sonobuoy run --plugin but if you have numerous plugins this can get tedious and is more frustrating to script around.

I'd like to be able to specify something like sonobuoy run --plugin-dir or --plugins which may take a directory.

I think this would just be a shortcut for adding all those plugins one-by-one and wouldn't require much effort.

Anything else you would like to add:
I don't think this has to be overthought or have complex interaction with the existing --plugin flag. I think it is reasonable to allow both to be set and they are all just additive (i.e. it would be valid to say --plugins lotsOfPluginsInThisDir --plugin alsoAddThisOne.yaml

I am hitting this because of the integration suite we are putting together and I am currently creating lots of yaml plugin definitions and want to run them all.

@zubron
Copy link
Contributor

zubron commented Sep 25, 2019

I have a slight preference here for --plugin-dir, just because of how similar --plugin and --plugins are.

@johnSchnake
Copy link
Contributor Author

I don't think it would be hard to just change the flag handling to even let --plugin just handle files or directories. If it is a directory it will just load all the *.yaml files it finds in that directory.

It will prevent a new flag from being needed and just expands the use of that flag in a pretty resaonable way IMO.

johnSchnake added a commit that referenced this issue Sep 27, 2019
If someone specifies `sonobuoy run|gen --plugin X` then X ought to
be allowed to be either a single plugin file or a directory of plugins.

To avoid dropping errors intentionally or processing lots of unnecessary
files, when processing a directory, we only consider *.yaml files. We
also do not recurse deeper into the directory.

Fixes #906

Signed-off-by: John Schnake <[email protected]>
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 a pull request may close this issue.

2 participants