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

When 2 images with same SHA are reference by 2 nested bundles #638

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

joaopapereira
Copy link
Member

When there are 2 nested bundles that reference the same image (AKA the same SHA) these images are considered as separated images internally. This behavior causes problems when imgpkg is trying to create the Locations image because it searches for the images by SHA, creating a dupplicated entry.

To fix this we decided to force imgpkg to select only one of the entries to add to the Locations list.

This could be averted as well if we stored only 1 copy of these images in the UnprocessedImagesRef struct the main issue is that this is going to hide from imgpkg that the same image is referenced from 2 different sources, this might cause problems in the long run, specially if one day we decide to implement the ability for users to copy bundles to different locations in the destination repository.

When there are 2 nested bundles that reference the same image (AKA the
same SHA) these images are considered as separated images internally.
This behavior causes problems when imgpkg is trying to create the
Locations image because it searches for the images by SHA, creating a
dupplicated entry.

To fix this we decided to force imgpkg to select only one of the entries
to add to the Locations list.

This could be averted as well if we stored only 1 copy of these images
in the UnprocessedImagesRef struct the main issue is that this is going
to hide from imgpkg that the same image is referenced from 2 different
sources, this might cause problems in the long run, specially if one day
we decide to implement the ability for users to copy bundles to
different locations in the destination repository.

Signed-off-by: Joao Pereira <[email protected]>
Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Ideally it would be good if there are tests for this, but since we have tested it manually and since it's a blocker, we will merge this and make a release, and add a test later on.

@praveenrewar praveenrewar merged commit 287c735 into develop Feb 26, 2024
8 checks passed
@praveenrewar praveenrewar deleted the same-img-different-repos-issue branch February 26, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants