Skip to content

Commit 5ae0e0d

Browse files
committed
cmd/podman: added virtual size option in artifact ls
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
1 parent 1671029 commit 5ae0e0d

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

cmd/podman/artifact/list.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ type listFlagType struct {
3636
}
3737

3838
type artifactListOutput struct {
39-
Digest string
40-
Repository string
41-
Size string
42-
Tag string
39+
Digest string
40+
Repository string
41+
Size string
42+
Tag string
43+
VirtualSize string
4344
}
4445

4546
var (
@@ -106,10 +107,11 @@ func outputTemplate(cmd *cobra.Command, lrs []*entities.ArtifactListReport) erro
106107
}
107108

108109
artifacts = append(artifacts, artifactListOutput{
109-
Digest: artifactHash,
110-
Repository: named.Name(),
111-
Size: units.HumanSize(float64(lr.Artifact.TotalSizeBytes())),
112-
Tag: tag,
110+
Digest: artifactHash,
111+
Repository: named.Name(),
112+
Size: units.HumanSize(float64(lr.Artifact.TotalSizeBytes())),
113+
Tag: tag,
114+
VirtualSize: fmt.Sprintf("%d", lr.Artifact.TotalSizeBytes()),
113115
})
114116
}
115117

docs/source/markdown/podman-artifact-ls.1.md.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Print results with a Go template.
2222
| .Repository | Repository name of the artifact |
2323
| .Size | Size artifact in human readable units |
2424
| .Tag | Tag of the artifact name |
25+
| .VirtualSize | Size of artifact in bytes |
2526

2627
@@option no-trunc
2728

0 commit comments

Comments
 (0)