-
Notifications
You must be signed in to change notification settings - Fork 293
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
Add an option to retag rather than replacing the target image while rebasing #2023
Conversation
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.
@Parthiba-Hazra thank you for picking this up! I think unfortunately the requirements were not too clearly specified in the original issue - I left some suggestions below. Let us know what you think :)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2023 +/- ##
==========================================
+ Coverage 79.69% 79.72% +0.04%
==========================================
Files 176 176
Lines 13257 13263 +6
==========================================
+ Hits 10564 10573 +9
+ Misses 2023 2021 -2
+ Partials 670 669 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
…ebasing Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com> add an option to "retag" rather than replacing the target image while rebasing Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Co-authored-by: Natalie Arellano <narellano@vmware.com> Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
During builder creation, end-users can provide the flag `--flatten` with the buildpacks they want to put in one layer. Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
… purpose. If previous-image flag set then workingImage will be based off of opts.PreviousImage in the rebaser.Rebase Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com> fix merge conflicts Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com> resolve merge conflict Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com>
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.
@Parthiba-Hazra thank you for this! I left a couple nits, but overall this looks good :)
Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com> update documentation for PreviousImage filed in RebaseOptions Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com> update docs Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com>
repoName = opts.PreviousImage | ||
} | ||
|
||
appImage, err := c.imageFetcher.Fetch(ctx, repoName, image.FetchOptions{Daemon: !opts.Publish, PullPolicy: opts.PullPolicy}) |
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.
Could you add some test coverage for this method?
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.
yes sure, let me check.
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.
@jjbustamante can you check if I am missing some other scenarios.
Signed-off-by: Parthiba-Hazra <parthibahazra@gmail.com>
Manual Test
> git:(retag) out/pack rebase --previous-image jbustamantevmware/my-spring-app:latest jbustamantevmware/my-spring-app:sometag --publish
Rebasing jbustamantevmware/my-spring-app:latest on run image index.docker.io/paketobuildpacks/run-jammy-base:latest
Saving jbustamantevmware/my-spring-app:sometag...
*** Images (sha256:ca7d958efd12d2b9c409e803d4f5b78dc9496ba1c1d3457a8f25103956f8a8e4):
jbustamantevmware/my-spring-app:sometag
Rebased Image: index.docker.io/jbustamantevmware/my-spring-app@sha256:ca7d958efd12d2b9c409e803d4f5b78dc9496ba1c1d3457a8f25103956f8a8e4
Successfully rebased image jbustamantevmware/my-spring-app:sometag As we can see a new tag was created for my application |
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.
@Parthiba-Hazra Thank you so much for this!
Resolves #1748