(ctx context.Context, snapshotter snapshots.Snapshotter, snapshotKey string)
| 231 | } |
| 232 | |
| 233 | func getContainerSize(ctx context.Context, snapshotter snapshots.Snapshotter, snapshotKey string) (string, error) { |
| 234 | // get container snapshot size |
| 235 | var containerSize int64 |
| 236 | var imageSize int64 |
| 237 | |
| 238 | if snapshotKey != "" { |
| 239 | rw, all, err := imgutil.ResourceUsage(ctx, snapshotter, snapshotKey) |
| 240 | if err != nil { |
| 241 | return "", err |
| 242 | } |
| 243 | containerSize = rw.Size |
| 244 | imageSize = all.Size |
| 245 | } |
| 246 | |
| 247 | return fmt.Sprintf("%s (virtual %s)", progress.Bytes(containerSize).String(), progress.Bytes(imageSize).String()), nil |
| 248 | } |
no test coverage detected
searching dependent graphs…