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

fix(RELEASE-999): check for existing Pyxis image #319

Closed
wants to merge 1 commit into from

Conversation

mmalina
Copy link
Contributor

@mmalina mmalina commented Nov 18, 2024

The function that checks if the image already exists in Pyxis would always use repositories.manifest_schema2_digest in the query. But we only set that field for non-multiarch images. For multiarch, we set repositories.manifest_list_digest.

So that means that for multiarch images, I don't see how this could ever work.

The obvious fix would be to search for the right field for the particular image. The issue with that is that for multiarch images, we would have the same manifest list entry for each of the arch images, so we would only create the first one and all the rest would be skipped. So instead, let's use the image_id field which is set to the arch specific digest (for single arch, it's the main digest).

The function that checks if the image already exists in Pyxis
would always use `repositories.manifest_schema2_digest`
in the query. But we only set that field for non-multiarch images.
For multiarch, we set `repositories.manifest_list_digest`.

So that means that for multiarch images, I don't see how this could
ever work.

The obvious fix would be to search for the right field for
the particular image. The issue with that is that for multiarch
images, we would have the same manifest list entry for each
of the arch images, so we would only create the first one and
all the rest would be skipped. So instead, let's use
the image_id field which is set to the arch specific digest
(for single arch, it's the main digest).

Signed-off-by: Martin Malina <[email protected]>
@mmalina mmalina requested a review from a team as a code owner November 18, 2024 14:24
@mmalina
Copy link
Contributor Author

mmalina commented Nov 18, 2024

Actually, it turns out I wasn't reading the code correctly. My PR is not needed. The check works fine, because manifest_schema2_digest is set even for multiarch images. What we do is:

  • Always set repositories.manifest_schema2_digest
  • For multiarch, also set repositories.manifest_list_digest

Given that repositories.manifest_schema2_digest is always the unique image digest (not the manifest list one), using it in the existing image search is fine.

@mmalina mmalina closed this Nov 18, 2024
@mmalina mmalina deleted the existing-image branch November 18, 2024 15:51
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.

1 participant