Skip to content
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

layers.Wipe(): try to remove layers before their parents #1342

Merged
merged 1 commit into from Sep 14, 2022

Conversation

nalind
Copy link
Member

@nalind nalind commented Sep 14, 2022

When removing layers, try to remove layers before removing their parents, as the lower-level driver may enforce the dependency beyond what the higher-level logic does or knows.

Do this by sorting by creation time as an attempt at flattening the layer tree into an ordered list. It won't be correct if a parent layer needed to be recreated, but it's more likely to be correct otherwise.

When removing layers, try to remove layers before removing their
parents, as the lower-level driver may enforce the dependency beyond
what the higher-level logic does or knows.

Do this by sorting by creation time as an attempt at flattening the
layer tree into an ordered list.  It won't be correct if a parent layer
needed to be recreated, but it's more likely to be correct otherwise.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Sep 14, 2022

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@giuseppe giuseppe merged commit 631b9cb into containers:main Sep 14, 2022
@nalind nalind deleted the wipe-order branch September 15, 2022 12:31
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.

None yet

3 participants