fix: make sure all whiteout files are processed#1887
Conversation
Signed-off-by: Kevin Conner <kev.conner@gmail.com>
2ea420b to
b3fe47d
Compare
|
f45f117 for reference |
Yeah, using a slice was my original approach from a year or so back. I changed the implementation when I looked at the way the tests were being written, assuming the intent was to coalesce the entries. Any idea why that's not in main? |
|
I believe it was a classic case of "fix a bug while working on a feature and then decide on a new approach for the feature and lose the bug-fix" |
crozzy
left a comment
There was a problem hiding this comment.
I left a couple of comments, both seem kind of pre-existing but it'd be good to fold in if possible
| Path: "a/path/to/some/different_file/site-packages/.wh.a_package", | ||
| Kind: claircore.FileKindWhiteout, | ||
| Files: map[string]map[string]claircore.FileKind{ | ||
| secondLayerHash.String(): map[string]claircore.FileKind{ |
There was a problem hiding this comment.
This should be inserting 3 different files into the same layer hash key rather than overwriting it. Existing bug but seems like a good time to address.
| slog.DebugContext(ctx, "package determined to be deleted", | ||
| "package name", pkg.Name, | ||
| "package file", pkg.Filepath, | ||
| "whiteout file", path) |
There was a problem hiding this comment.
Can we bail out here rather than checking the rest of the files / layers?
This PR fixes the mapping for
IndexReportfiles within a layer. The previous mapping was for one file per layer, with one consequence being the inability to handle more than one whiteout file per layer.