mirror of
https://github.com/containers/podman.git
synced 2025-06-19 00:06:43 +08:00
Don't fail on size.
I think a created container which was never run will have no size struct we should just return 0 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1288 Approved by: TomSweeneyRedHat
This commit is contained in:

committed by
Atomic Bot

parent
cd73f77414
commit
89a9750b6d
@ -522,9 +522,10 @@ func getTemplateOutput(psParams []psJSONParams, opts shared.PsOptions) ([]psTemp
|
||||
}
|
||||
if opts.Size {
|
||||
if psParam.Size == nil {
|
||||
return nil, errors.Errorf("Container %s does not have a size struct", psParam.ID)
|
||||
size = units.HumanSizeWithPrecision(0, 0)
|
||||
} else {
|
||||
size = units.HumanSizeWithPrecision(float64(psParam.Size.RwSize), 3) + " (virtual " + units.HumanSizeWithPrecision(float64(psParam.Size.RootFsSize), 3) + ")"
|
||||
}
|
||||
size = units.HumanSizeWithPrecision(float64(psParam.Size.RwSize), 3) + " (virtual " + units.HumanSizeWithPrecision(float64(psParam.Size.RootFsSize), 3) + ")"
|
||||
}
|
||||
if opts.Pod {
|
||||
pod = psParam.Pod
|
||||
|
Reference in New Issue
Block a user