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

[24.0 backport] c8d/container: Follow snapshot parents for size calculation #46097

Merged
merged 1 commit into from Jul 28, 2023

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Jul 28, 2023

This fixes docker ps -s -a and docker container prune failing when there's a container which image's config is no longer present in the content store.

- What I did
Refactor GetContainerLayerSize to calculate unpacked image size only by following the snapshot parent tree directly instead of following it by using diff ids from image config.

This works even if the original manifest/config used to create that container is no longer present in the content store.

- How I did it

- How to verify it

- Description for the changelog

- Fix `docker ps -s -a` and `docker container prune` failing when there's a container which image's config is no longer present in the content store.

- A picture of a cute animal (not mandatory but encouraged)

Refactor GetContainerLayerSize to calculate unpacked image size only by
following the snapshot parent tree directly instead of following it by
using diff ids from image config.

This works even if the original manifest/config used to create that
container is no longer present in the content store.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 4d8e3f5)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added status/2-code-review area/images kind/bugfix PR's that fix bugs kind/refactor PR's that refactor, or clean-up code containerd-integration Issues and PRs related to containerd integration labels Jul 28, 2023
@vvoland vvoland added this to the 24.0.6 milestone Jul 28, 2023
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 9e5726d into moby:24.0 Jul 28, 2023
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/images containerd-integration Issues and PRs related to containerd integration kind/bugfix PR's that fix bugs kind/refactor PR's that refactor, or clean-up code status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants