Skip to content
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 interface method, AddOrReuseLayerWithHistory #266

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

natalieparellano
Copy link
Member

The lifecycle currently does some bookkeeping to map a layer's "id" ("buildpack-id:layer-name") to the SHA of the layer in the previous image. It then compares this SHA to the SHA of the layer directory in the build container to determine if a layer should be added or re-used.

This works fine for layers that have an id (i.e., were created by a buildpack) but for extension layers we don't have a way to construct the mapping and simply want to add the layer if it's not present in the previous image, otherwise re-use it.

An imgutil.Image already has all the info necessary to determine whether a layer should be added or re-used, so adding an interface method is helpful for the lifecycle to avoid having to know anything about the previous image (at least for extension layers).

@natalieparellano natalieparellano requested a review from a team as a code owner April 12, 2024 15:11
@natalieparellano natalieparellano changed the base branch from main to add/err-layer-not-found April 12, 2024 15:12
@natalieparellano
Copy link
Member Author

Branches off #265

@natalieparellano natalieparellano changed the base branch from add/err-layer-not-found to main April 12, 2024 15:54
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@natalieparellano natalieparellano merged commit 7ea6c92 into main Apr 12, 2024
3 checks passed
@natalieparellano natalieparellano deleted the add/or-reuse-layer branch April 12, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants