Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

layer diff depends on layer ordering #239

Closed
aaron-prindle opened this issue Jun 4, 2018 · 4 comments
Closed

layer diff depends on layer ordering #239

aaron-prindle opened this issue Jun 4, 2018 · 4 comments

Comments

@aaron-prindle
Copy link
Collaborator

currently when diffing layers of images, container-diff essentially requires layers to in the same order and have the same number of layers for the diff to be meaningful. A single missing layer early will cause the layer introspection to compare "the wrong" layers. it would be awesome if container-diff could try to correlate the layers but it is understandable if this is outside the scope of container-diff

@nkubala
Copy link
Contributor

nkubala commented Jun 11, 2018

I agree this would be great, but I'm not totally sure what it would look like. Layer comparison is hard because we don't really have a good way of "correlating" layers. SHAs don't work because adding a single file to a layer gives it an entirely new SHA. We could try and do something clever with sizes (for each layer, find the layer closest in size and compare those two), but there are corner cases where that would break down and give us garbage results. Any suggestions for a better way to go about this are certainly welcome :)

@davidcassany
Copy link
Contributor

davidcassany commented Jun 27, 2018

just an idea, but probably something similar to what was suggested in #233 (review) would do the trick. Instead of trying to guess the layers to compare, let user select them by introducing somehow the layer IDs to compare.

@nkubala
Copy link
Contributor

nkubala commented Jul 20, 2018

I think that's a fine idea actually, as discussed in #248 it's probably the only option for comparing images with a variable number of layers. Are you interested in sending a PR?

@davidcassany
Copy link
Contributor

@nkubala I can try to make a PR for that, probably it will take me some days to find the spare cycles to do it, but I'll try to come up with a suggestion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants