-
Notifications
You must be signed in to change notification settings - Fork 400
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
Unconditionally set the base image annotation. #745
Conversation
Previously we only set this annotation when our base image was a tag, but this means when folks actually follow the best practice of use digest base images they get strictly worse resulting images! It sounds like maybe the original motivation for this condition was that it was supposed to contain the mutable reference (tag), but I don't see anything detailing such a restriction (just an example), so there should be nothing precluding this from the spec.
This also supports: #744 |
Codecov Report
@@ Coverage Diff @@
## main #745 +/- ##
==========================================
- Coverage 51.38% 51.35% -0.03%
==========================================
Files 44 44
Lines 3295 3293 -2
==========================================
- Hits 1693 1691 -2
Misses 1390 1390
Partials 212 212
Continue to review full report at Codecov.
|
pkg/build/gobuild.go
Outdated
if _, ok := baseRef.(name.Tag); ok { | ||
anns[specsv1.AnnotationBaseImageName] = baseRef.Name() | ||
} | ||
anns[specsv1.AnnotationBaseImageName] = baseRef.Name() |
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.
The nittiest of nits: can you just put this in the map initialization expression above, with the other one?
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.
Done!
Previously we only set this annotation when our base image was a tag, but this means when folks actually follow the best practice of use digest base images they get strictly worse resulting images!
It sounds like maybe the original motivation for this condition was that it was supposed to contain the mutable reference (tag), but I don't see anything detailing such a restriction (just an example), so there should be nothing
precluding this from the spec.