Skip to content

Conversation

@danishprakash
Copy link
Collaborator

Signed-off-by: Danish Prakash [email protected]

@danishprakash danishprakash marked this pull request as ready for review May 26, 2025 09:59
@danishprakash danishprakash requested a review from dcermak May 26, 2025 09:59
Copy link
Owner

@dcermak dcermak left a comment

Choose a reason for hiding this comment

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

LGTM overall, just added a few minor points

@dcermak
Copy link
Owner

dcermak commented Jul 17, 2025

@danishprakash rebase pls 🥺

@danishprakash danishprakash force-pushed the top-for-layer branch 2 times, most recently from fba79fc to bd617c2 Compare July 28, 2025 17:10
@danishprakash danishprakash requested review from dcermak and removed request for dcermak July 28, 2025 17:11
Copy link
Owner

@dcermak dcermak left a comment

Choose a reason for hiding this comment

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

Overall very good, I have added a bunch of nitpicks and suggestions all over the place.

I do have one nomenclature fixing request: we must really be consistent with naming here. The new top feature calls image digests sometimes digests and sometimes IDs, which is not consistent with podman's naming. Iirc the layer ID is some internal representation, while the digest is defined in the image. Hence I would suggest, that we use the name digest everywhere instead of ID.

@danishprakash danishprakash force-pushed the top-for-layer branch 5 times, most recently from 2780dcf to 6ee6b17 Compare August 20, 2025 09:26
Copy link
Owner

@dcermak dcermak left a comment

Choose a reason for hiding this comment

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

I like where you are going with the ID changes to use the image layer digest, but the naming is still inconsistent and now the UX is more confusing, because you filter by layer digest and display the registry digest.

@danishprakash danishprakash force-pushed the top-for-layer branch 3 times, most recently from e323b95 to 4e9e89c Compare August 22, 2025 07:59

// getLayersByDiffID returns layer blob infos filtered by user-provided diffIDs
// by looking up diffIDs and mapping to manifest layers
func getLayersByDiffID(manifestLayers []types.BlobInfo, allDiffIDs []digest.Digest, filterDiffIDs []string) ([]types.BlobInfo, []digest.Digest, error) {
Copy link
Owner

Choose a reason for hiding this comment

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

Isn't BlobInfo.Digest usable in this context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Owner

Choose a reason for hiding this comment

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

the manifestLayers array is of type types.BlobInfo, which has a field Digest. Why not use that Digest instead of passing the additional allDiffIDs array with the digests as a separate parameter?

Copy link
Collaborator Author

@danishprakash danishprakash Aug 27, 2025

Choose a reason for hiding this comment

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

because manifestLayers[x].Digest isn't guaranteed to be the equivalent of diffID, it could also represent a compressed digest if the image is not in the local storage, for instance.

danishprakash and others added 5 commits August 25, 2025 14:11
Get top files for one or more layers specified via digest, partial or
complete. Errors out if the passed layers don't match any layer in the
image, or it matches more than one layers. Merges the output when more
than one layer is passed.

* add unit tests

Signed-off-by: Danish Prakash <[email protected]>
Co-authored-by: Dan Čermák <[email protected]>
@danishprakash danishprakash force-pushed the top-for-layer branch 2 times, most recently from bfbfdf4 to fd60d83 Compare August 27, 2025 08:29
@danishprakash danishprakash force-pushed the top-for-layer branch 4 times, most recently from 7b9bfa8 to dcfdf4c Compare August 27, 2025 17:41
Signed-off-by: Danish Prakash <[email protected]>
danishprakash and others added 2 commits August 28, 2025 01:38
Co-authored-by: Dan Čermák <[email protected]>
@danishprakash danishprakash requested a review from dcermak August 29, 2025 06:53
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.

3 participants