Don't fail on size.
I think a created container which was never run will have no size struct
we should just return 0
Closes:
Approved by: TomSweeneyRedHat
@@ -522,10 +522,11 @@ 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) + ")"
}
+ }
if opts.Pod {
pod = psParam.Pod
}
