-
Notifications
You must be signed in to change notification settings - Fork 112
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
Run image in pack inspect
is not correctly updated after rebasing
#1098
Comments
Hey guys 👋 I'll be checking this issue during the weekend |
Hello @hernandanielg, thanks for offering to look into this! |
hey @daniv-msft 👋🏻 I have checked and confirmed this issue
I have spotted that https://github.com/buildpacks/lifecycle/blob/main/rebaser.go#L80 is missing to update the following:
What do you think? am I going in the right direction? It's been hard to identify the issue as I am not familiarized with the code and I am struggling to test this, I think I'll ask for help in Slack 😉 |
@hernandanielg thanks for the update - you are right, this would need to be changed in the lifecycle. It seems to me that the CNB spec as currently written does not cover the use case where in As this seems to be more of a bug in the spec vs pack/lifecycle a good first step might be to open a PR against the platform spec, on or around here and then we can discuss it further. cc'ing also @jabrown85 & @joeybrown-sf as folks who might have thoughts around run image mirrors & rebase. |
Created this PR buildpacks/spec#360 we can discuss it there and then continue with the implementation here as @natalieparellano suggested ;) |
@harryli0108 @daniv-msft could we trouble you for a review on buildpacks/spec#360? Is this in line with what you were expecting? I'm going to move this issue over to the lifecycle as it would be implemented there. It should be a small change. If we act soon we could fold this into the next minor release. Would anyone be willing to take this on? |
Linked a PR that will close this issue |
Hi @natalieparellano and @hernandanielg. Thank you very much for the prompted replies and the quick PR! However, I'm still running into the same issue even with rebasing using the latest API version with the lts, prerelease, and the tar.gz created from the PR merge Github workflow. I use the following command to rebase the image using lifecycle: Afterwards, I run Could you take a look if possible? Much appreciated! |
Thanks for the report @harryli0108 - I'll take a look |
@harryli0108 I am probably doing something different than you, but I'm not seeing this behavior in my testing. I'm using the daemon here, but when I do:
The original run image is
The run image changed from
The new run image is It's worth noting, the logic changed slightly from the linked PR commit. That one has:
Whereas
To emphasize, when checking if "platform API is at least 0.12" we are looking at the platform API of the previously built image vs the platform API in Would it be possible to repeat your test using lifecycle |
@natalieparellano Thanks for looking into it! I've just tested with
And then rebasing it using lifecycle rebaser:
And then do another pack inspect:
One note about the first pack insepct. The run image it is referring to was supposed to be 7.0.5 rather than 7.0. That one isn't reflected correctly after build. |
Ah okay - what platform API was |
That is very weird. Is it possible that the metadata IS getting updated, but |
The |
Thanks @harryli0108 - could you try running
(re: my comment above) We discussed this in today's CNB Working Group (6/22) and we think it makes more sense to do the opposite check. In the current implementation, as What we thought makes more sense: when you provide I'm going to put up a PR shortly to fix - when that's ready would you be able to test it out? |
@natalieparellano Thanks for the reply! I've just ran the command and got Also, I'm open to test things out if there's a potential fix for this! Please feel free to ping me if the PR is out. |
@harryli0108 - thank you. I think the truncation/altering of the tag may be the real culprit here. I'll investigate... |
@harryli0108 could you run one more command please: |
yep, I still got |
Ah okay - then there is still ambiguity here (maybe we're truncating the tag, maybe we're failing to update the run image metadata). Would you mind conducting a test on the artifact from https://github.com/buildpacks/lifecycle/actions/runs/5348592701/jobs/9698656837 (when it finishes). You will need to provide |
I've just tested out. Seems like the issue still lingers. Here's the env vars I set: After running
Here's the stack run image metadata of this image:
Here's the run image metadata of this image:
|
@harryli0108 are you able to paste the log output from the rebase operation? |
I think I've figured out the issue - we weren't considering the tag part of the reference in our matching logic 😞 https://github.com/buildpacks/lifecycle/actions/runs/5349213062 should have the fix. |
Sorry for the delay of reply here. Here's the console log I have from the rebaser:
I've just tested and got the following error when running rebaser:
I'm wondering if this error should be expected in this case? |
I just realized I forgot to pass the
And when I do
Meanwhile, I'm wondering if this fix will also fix the |
Great news @harryli0108! Thank you for checking. I've added 5edfb9b to provide some hint about the
Apologies, I've gotten a little turned around here... is there an outstanding issue with rebase that I missed? |
Sorry for not explaining it clearly. The pack CLI rebase is still having the issue where run image metadata is not updated correctly. For instance:
|
Ohh I see what you're saying - yes, |
@natalieparellano Thanks for sharing the PR link! Just want to double check, will this also expose the |
Ah yes, the I'm going to go ahead and close this issue, but please let us know if you encounter any other issues! |
Summary
Run image in
pack inspect <img-name-1>
is not correctly updated after runningpack rebase <img-name-1> --run-image <img-name-2>
.Reproduction
Steps
docker build <run-img>
(Optional Step)pack inspect <img-name-1> --output json
and note the content in the run image partpack rebase <img-name-1> --run-image <run-img>
to rebase image 1 with a new run imagepack inspect <img-name-1> --output json
and note the content in the run image part again.Current behavior
The run image field when running pack inspect is not reflected correctly after rebase command.
Expected behavior
The run image name and tag should be changed after rebasing with a new run image.
The text was updated successfully, but these errors were encountered: