fix(RELEASE-999): check for existing Pyxis image #319
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 setrepositories.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).