fix image size#310
Merged
Merged
Conversation
ktock
reviewed
Aug 9, 2021
6cdffbb to
7048508
Compare
Member
Author
|
@ktock done |
ktock
reviewed
Aug 9, 2021
Comment on lines
+179
to
+189
| walkFn := func(ctx context.Context, info snapshots.Info) error { | ||
| keys[info.Name] = info.Parent | ||
| return nil | ||
| } | ||
| if err := s.Walk(ctx, walkFn); err != nil { | ||
| return 0, err | ||
| } |
Member
There was a problem hiding this comment.
Why does it scan all snapshots? Can we walk snapshots only in the chain? I think we can do this by following parents from the topmost snapshot using Stat API.
Member
Author
There was a problem hiding this comment.
@ktock thank you, This is what I was looking for ==> Stat API . I made modification.
a03a5e8 to
9e290f3
Compare
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
9e290f3 to
c6684a7
Compare
ktock
approved these changes
Aug 11, 2021
Member
|
CI wasn't triggered? |
AkihiroSuda
reviewed
Aug 12, 2021
| } | ||
|
|
||
| func unpackedImageSize(ctx context.Context, clicontext *cli.Context, client *containerd.Client, i images.Image) (int64, error) { | ||
| type snapshotKey string |
Member
There was a problem hiding this comment.
Why define new type just for a string?
Member
Author
There was a problem hiding this comment.
I have to define new local type to use it as a receiver to the add method. We cannot define the add method on non-local type string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the actual image size is equal to the ChainID size.
this PR use the Walk API and Usage on each parent of ChainID to calculate the total usage of unpacked image layers
related issue #304
Signed-off-by: fahed dorgaa fahed.dorgaa@gmail.com