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

Make 'sonobuoy retrieve' cli command aware if tarball is available or not #407

Closed
mwieczorek opened this issue Apr 4, 2018 · 2 comments · Fixed by #453
Closed

Make 'sonobuoy retrieve' cli command aware if tarball is available or not #407

mwieczorek opened this issue Apr 4, 2018 · 2 comments · Fixed by #453
Labels
kind/bug Behavior isn't as expected or intended lifecycle/active Actively being worked on p0-highest

Comments

@mwieczorek
Copy link

Is this a BUG REPORT or FEATURE REQUEST?:
FEATURE REQUEST

What happened:
I prepared script to run sonobuoy and gather results. Basically script has steps:

  1. sonobuoy run
  2. in a loop wait for all plugins to complete
  3. sonobuoy retrieve
  4. tar xzf *.tar.gz

Last step failed because there is no tarball after retrieve, just a folder (with UID as name). Sonobuoy returned 0 exit code.

What you expected to happen:
It would be better UX if sonobuoy cli retrieve would return some errorCodes, f.e.:
0 - ok, tarball downloaded
1 - error, cannot retrieve the tarball, not recoverable error
2 (or other number) - tarball not ready, you can try again later

I think it would make scripting easier (now I can just check if there's a tarball in specified folder)

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Sonobuoy tarball (which contains * below)
  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
@timothysc timothysc added this to the v1.0.0 milestone Apr 4, 2018
@timothysc timothysc added kind/bug Behavior isn't as expected or intended p1-important labels Apr 4, 2018
@johnSchnake
Copy link
Contributor

I currently have a very similar problem; I'm thinking the cause is that I'm trying to get the tarball just slightly before its ready (sonobuoy status says it is done with tests) but sometimes I get the tarball and sometimes I get the directory. Frustrating behavior, even if not technically a bug.

@mwieczorek
Copy link
Author

@johnSchnake I was in the same situation - that's why I created this issue.
In the meantime if I want to automate sonobuoy scan I just loop and check if I got tar of not.

@timothysc timothysc modified the milestones: v1.0.0, v1.11-upstream sync Jun 25, 2018
@liztio liztio added the lifecycle/active Actively being worked on label Jun 25, 2018
@timothysc timothysc assigned liztio and unassigned chuckha Jun 25, 2018
liztio added a commit to liztio/sonobuoy that referenced this issue Jun 27, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407
liztio added a commit to liztio/sonobuoy that referenced this issue Jun 27, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407

Signed-off-by: liz <liz@heptio.com>
liztio added a commit to liztio/sonobuoy that referenced this issue Jun 27, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407

Signed-off-by: liz <liz@heptio.com>
liztio added a commit to liztio/sonobuoy that referenced this issue Jun 27, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407

Signed-off-by: liz <liz@heptio.com>
liztio added a commit to liztio/sonobuoy that referenced this issue Jun 27, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407

Signed-off-by: liz <liz@heptio.com>
liztio added a commit to liztio/sonobuoy that referenced this issue Jul 9, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407

Signed-off-by: liz <liz@heptio.com>
liztio added a commit to liztio/sonobuoy that referenced this issue Jul 9, 2018
sonobuoy retrieve now has better, more user-friendly error handling

closes vmware-tanzu#407

Signed-off-by: liz <liz@heptio.com>
timothysc pushed a commit that referenced this issue Jul 9, 2018
* Add errgroup dependency

Signed-off-by: liz <liz@heptio.com>

* client.Retrieve now returns an error channel instead of error

sonobuoy retrieve now has better, more user-friendly error handling

closes #407

Signed-off-by: liz <liz@heptio.com>
@timh timh unassigned liztio Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Behavior isn't as expected or intended lifecycle/active Actively being worked on p0-highest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants