-
Notifications
You must be signed in to change notification settings - Fork 527
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
Implement annotation-based rebase hints #960
Conversation
7b856c9
to
ae7e1ca
Compare
Codecov Report
@@ Coverage Diff @@
## main #960 +/- ##
==========================================
- Coverage 73.05% 72.31% -0.75%
==========================================
Files 107 108 +1
Lines 4792 4858 +66
==========================================
+ Hits 3501 3513 +12
- Misses 775 827 +52
- Partials 516 518 +2
Continue to review full report at Codecov.
|
a210291
to
7f23862
Compare
ce92012
to
e994afe
Compare
Codecov Report
@@ Coverage Diff @@
## main #960 +/- ##
=======================================
Coverage 75.44% 75.44%
=======================================
Files 108 108
Lines 7692 7692
=======================================
Hits 5803 5803
Misses 1334 1334
Partials 555 555 Continue to review full report at Codecov.
|
6e64c12
to
7e0d5e7
Compare
b7d5960
to
a3db8db
Compare
0b0fec4
to
fd79eba
Compare
`crane rebase` now inspects the original image for annotations to identify its old base and new base images. If those are found, and --old_base and --new_base flags aren't specified, those will be used. If the --rebased flag is not passed, the rebased image will be the tagged with the original image reference; if it was originally specified by digest, the rebased image will be tagged with :rebased (instead of stripping the digest and pushing to :latest) `crane rebase` now prints the full pushed image reference, instead of just the digest (aiding embedding in other bash pipelines), and adds annotations to aid future rebasings. This also adds a bash test that covers the rebase case for detected base image information.
rm ${tmp}/b.txt | ||
|
||
# Rebase using annotations | ||
rebased=$(./crane rebase ${orig}) |
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.
This is amazing 👍
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.
Thanks. I still need to hook it up into CI tests...
Wanna do that? If not, ready for final review? |
Done, anything else you'd like to see? |
Adds
crane.Rebase
helper function for higher-level functionality including annotation-based hintsWith this change,
crane rebase <image>
without args will attempt to determine the old and new base from (WIP placeholder) annotations, perform the rebase, and push a new image back to<image>
(--rebased
flag will override). The rebased image will have base-by-digest and base-by-tag annotations added for future rebase operations.--original
if provided overrides the positional arg--old_base
and--new_base
override any detected annotations--rebased
(deprecated, now--tag
to match other surfaces) overrides pushing over the original imagebase-digest
andbase-tag
annotations are populated from--new_base
by digest+tag (or previously detectedbase-tag
)This is WIP while we sort out whether the annotation will be a reserved annotation in the OCI spec. If the code looks good, I'll take a stab at updating rebase.md as well (it could probably use it anyway 😅 ).