mirror of
https://github.com/containers/podman.git
synced 2025-10-20 12:43:58 +08:00
cmd/podman: added virtual size option in artifact ls
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
This commit is contained in:
@ -36,10 +36,11 @@ type listFlagType struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type artifactListOutput struct {
|
type artifactListOutput struct {
|
||||||
Digest string
|
Digest string
|
||||||
Repository string
|
Repository string
|
||||||
Size string
|
Size string
|
||||||
Tag string
|
Tag string
|
||||||
|
VirtualSize string
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -106,10 +107,11 @@ func outputTemplate(cmd *cobra.Command, lrs []*entities.ArtifactListReport) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
artifacts = append(artifacts, artifactListOutput{
|
artifacts = append(artifacts, artifactListOutput{
|
||||||
Digest: artifactHash,
|
Digest: artifactHash,
|
||||||
Repository: named.Name(),
|
Repository: named.Name(),
|
||||||
Size: units.HumanSize(float64(lr.Artifact.TotalSizeBytes())),
|
Size: units.HumanSize(float64(lr.Artifact.TotalSizeBytes())),
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
|
VirtualSize: fmt.Sprintf("%d", lr.Artifact.TotalSizeBytes()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ Print results with a Go template.
|
|||||||
| .Repository | Repository name of the artifact |
|
| .Repository | Repository name of the artifact |
|
||||||
| .Size | Size artifact in human readable units |
|
| .Size | Size artifact in human readable units |
|
||||||
| .Tag | Tag of the artifact name |
|
| .Tag | Tag of the artifact name |
|
||||||
|
| .VirtualSize | Size of artifact in bytes |
|
||||||
|
|
||||||
@@option no-trunc
|
@@option no-trunc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user