-
Notifications
You must be signed in to change notification settings - Fork 4
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 oci whiteout implementation #8
Comments
A simple idea would be to add generation counters to our I'd honestly prefer to find a better way to deal with this, because this approach inserts some weird kind of non-normative metadata into a data structure which we use as part of a chain to produce results that must be deterministic. Another idea is that during the extraction of each layer, we could maintain a HashSet of addresses of the entries we created during that step, using it in a similar way to the generation counter. We have to be careful with this approach: if we used the addresses of the DirEnt structs for example we would be in trouble since those are subject to reallocation. The fact that we use Similarly, we could also add the involved filenames to the set. It would be nice if we could avoid that one, though, since it's quite a lot "heavier". |
I just read a bit about how mutable modifies to the contents of |
Okay, |
Annoyingly, not available in stable yet: rust-lang/rust#129090. I'm sure it's possible to work around this issue, anyway... |
The |
I implemented whiteouts in the image-merging code without having read the spec.
https://github.com/opencontainers/image-spec/blob/main/layer.md
There are two things that need fixing:
If we encounter a whiteout file in a layer tarball after that file was added in the same tarball we're going to delete it again. We could argue that the tarball is not a valid layer because it attempts to do something that the spec says that it shouldn't, but at the very least we should try to detect this situation, and probably we do need to support it (since a SHOULD is only a SHOULD).
This is going to be very difficult. The good news: this isn't a problem as long as we're only dealing with layers produced in the way that they SHOULD have been.
We just need to add support for this (but need to be careful about the interaction with the above). Assuming we've managed to solve the above issue, this issue will be trivial.
The text was updated successfully, but these errors were encountered: