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

New version warning output leak in quiet mode #962

Closed
adrienjt opened this issue Sep 10, 2018 · 4 comments · Fixed by #964
Closed

New version warning output leak in quiet mode #962

adrienjt opened this issue Sep 10, 2018 · 4 comments · Fixed by #964
Labels
kind/bug Something isn't working priority/p0 Highest priority. We are actively looking at delivering it.

Comments

@adrienjt
Copy link

Expected behavior

Even when I'm running an outdated version of skaffold, skaffold build -q should only return the templated output, e.g.:

registry/org/image -> registry/org/image:tag

This is especially important when skaffold is run by a CI/CD script.

Actual behavior

Running skaffold v0.12.0, skaffold build -q returns the templated output directly followed by the new version warning, e.g.:

registry/org/image -> registry/org/image:tag
There is a new version (0.13.0) of skaffold available. Download it at https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64

@balopat balopat added kind/bug Something isn't working area/release priority/p0 Highest priority. We are actively looking at delivering it. labels Sep 10, 2018
@r2d4
Copy link
Contributor

r2d4 commented Sep 10, 2018

Good catch, you're absolutely right. Sent a fix

@adrienjt
Copy link
Author

Thank you for the fix @r2d4 . Actually, I would go a step further and say that, even in "not-quiet" mode, the warning should not appear after the requested templated output. A client may want to see the full log and parse the last line(s) for the requested templated output, e.g., an image tag. IMHO, warnings are safer at the very beginning of stdout... at the risk of being overlooked. What do you think?

@r2d4
Copy link
Contributor

r2d4 commented Sep 13, 2018

I like the idea @adrienjt, however its implemented a bit differently. We send out a request at the start of the command to check for the update. If that command succeeds before the update check returns, we forget about it so that no extra latency is added. If the update check returns before the command exits, we queue it up and possibly print it at the end.

There is an environment variable SKAFFOLD_UPDATE_CHECK=false that you can set to disable it, which helps a bit.

UpdateCheckEnvironmentVariable = "SKAFFOLD_UPDATE_CHECK"

@adrienjt
Copy link
Author

Thank you for the explanation @r2d4, you're right, I wouldn't want a non-critical feature (really just informational) to block the critical path. The environment variable is a perfectly fine solution, especially because I don't think I would need it as a human, so I'll just set it in my CI/CD scripts. For other users, it would be nice to document those environment variables, not just in the source code.

Another option would be to display the warning between the Docker output and the templated output, if it's ready by that time, which is more or less the same time as at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working priority/p0 Highest priority. We are actively looking at delivering it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants