-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(ko): Display correct tag for sideloaded images #6836
fix(ko): Display correct tag for sideloaded images #6836
Conversation
Display the expected tag after successfully building a ko image, for both sideloaded and published images. Also handles the `tagPolicy.sha256` scenarios. Fixes: GoogleContainerTools#6835 Tracking: GoogleContainerTools#6041
b0da432
to
8033e5a
Compare
Codecov Report
@@ Coverage Diff @@
## main #6836 +/- ##
==========================================
- Coverage 70.48% 69.14% -1.35%
==========================================
Files 515 547 +32
Lines 23150 25036 +1886
==========================================
+ Hits 16317 17310 +993
- Misses 5776 6563 +787
- Partials 1057 1163 +106
Continue to review full report at Codecov.
|
fmt.Fprintln(out, imageRef.Name()) | ||
|
||
outputRef := ref | ||
if strings.HasSuffix(ref, ":latest") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does Ko only do use the digest for :latest?
Marking as draft until I have time to get back to this one. I think some tweaks may be needed. |
With this change, the `ko` builder no longer prints the image name to `stdout` by default. Originally, this was added to the `ko` builder to mimic the behavior of the `ko` CLI. Other Skaffold image builders do not print the image name in this way. The reason this is useful for existing `ko` CLI users is that some documented workflows rely on capturing the image name from `stdout`, see https://github.com/google/ko/blob/v0.9.3/README.md#build-an-image After some investigation, the better option seems to be to rely on the existing `--quiet` and `--output` Skaffold flags to format the output of the image name(s). This change also updates the `ko` builder documentation to show existing `ko` CLI users how to capture the image name by providing an appropriate Go template to `--output`. Fixes: GoogleContainerTools#6835 Closes: GoogleContainerTools#6836 Tracking: GoogleContainerTools#6041
With this change, the `ko` builder no longer prints the image name to `stdout` by default. Originally, this was added to the `ko` builder to mimic the behavior of the `ko` CLI. Other Skaffold image builders do not print the image name in this way. The reason this is useful for existing `ko` CLI users is that some documented workflows rely on capturing the image name from `stdout`, see https://github.com/google/ko/blob/v0.9.3/README.md#build-an-image After some investigation, the better option seems to be to rely on the existing `--quiet` and `--output` Skaffold flags to format the output of the image name(s). This change also updates the `ko` builder documentation to show existing `ko` CLI users how to capture the image name by providing an appropriate Go template to `--output`. Fixes: GoogleContainerTools#6835 Closes: GoogleContainerTools#6836 Tracking: GoogleContainerTools#6041
Closing in favor of #6928 |
Display the expected tag after successfully building a ko image, for both sideloaded and published images.
Also handles the
tagPolicy.sha256
scenarios.Fixes: #6835
Tracking: #6041