-
Notifications
You must be signed in to change notification settings - Fork 234
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
store.DeleteImage: correctly account for mapped layers #1062
Conversation
@nalind Plz correct me if i am wrong. Actual logic change is in only But now its changed to map Change LGTM |
Not related to this PR: This needs a bit of re-phrasing/re-wording comment here is a bit confusing to read at first https://github.com/containers/storage/blob/main/store.go#L242 but could me only me. |
284ade8
to
f882e16
Compare
LGTM, as @flouthoc pointed out, could we move the change in |
f882e16
to
f3f7040
Compare
Dropped the bit from |
f3f7040
to
3df4c9f
Compare
When walking the list of layers in an image to decide which of them to remove as part of removing that image, we check that each candidate layer is a) not being used as the top layer for any other images, and b) that the only layer that lists a candidate layer as its parent layer is either the top layer of the image we're removing, or the previous layer that we decided should be removed. When the image has multiple top layers because some of them are alternate top layers which use different ID mappings, that second check didn't account for those mapped layers as being layers that shouldn't prevent us from removing a candidate layer. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
3df4c9f
to
5d127a5
Compare
Going to force merge, to ignore devicemapper flake. |
When walking the list of layers in an image to decide which of them to remove as part of removing that image, we check that each candidate layer is a) not being used as the top layer for any other images, and b) that the only layer that lists a candidate layer as its parent layer is either the top layer of the image we're removing, or the previous layer that we decided should be removed.
When the image has multiple top layers because some of them are alternate top layers which use different ID mappings, that second check didn't account for those mapped layers as being layers that shouldn't prevent us from removing a candidate layer.
Fixes containers/podman#12316.