mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
Use bytes size consistently instead of human size
Previously podman was using "MB" and "GB" (binary) for input but "MB" and "GB" (decimal) for output, which was causing confusion. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
This commit is contained in:
@ -61,7 +61,7 @@ func init() {
|
||||
flags.Uint64Var(
|
||||
&initOpts.DiskSize,
|
||||
diskSizeFlagName, cfg.ContainersConfDefaultsRO.Machine.DiskSize,
|
||||
"Disk size in GB",
|
||||
"Disk size in GiB",
|
||||
)
|
||||
|
||||
_ = initCmd.RegisterFlagCompletionFunc(diskSizeFlagName, completion.AutocompleteNone)
|
||||
@ -70,7 +70,7 @@ func init() {
|
||||
flags.Uint64VarP(
|
||||
&initOpts.Memory,
|
||||
memoryFlagName, "m", cfg.ContainersConfDefaultsRO.Machine.Memory,
|
||||
"Memory in MB",
|
||||
"Memory in MiB",
|
||||
)
|
||||
_ = initCmd.RegisterFlagCompletionFunc(memoryFlagName, completion.AutocompleteNone)
|
||||
|
||||
|
@ -216,8 +216,8 @@ func toHumanFormat(vms []*machine.ListResponse) ([]*entities.ListReporter, error
|
||||
response.Created = units.HumanDuration(time.Since(vm.CreatedAt)) + " ago"
|
||||
response.VMType = vm.VMType
|
||||
response.CPUs = vm.CPUs
|
||||
response.Memory = units.HumanSize(float64(vm.Memory))
|
||||
response.DiskSize = units.HumanSize(float64(vm.DiskSize))
|
||||
response.Memory = units.BytesSize(float64(vm.Memory))
|
||||
response.DiskSize = units.BytesSize(float64(vm.DiskSize))
|
||||
|
||||
humanResponses = append(humanResponses, response)
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func init() {
|
||||
flags.Uint64Var(
|
||||
&setFlags.DiskSize,
|
||||
diskSizeFlagName, 0,
|
||||
"Disk size in GB",
|
||||
"Disk size in GiB",
|
||||
)
|
||||
|
||||
_ = setCmd.RegisterFlagCompletionFunc(diskSizeFlagName, completion.AutocompleteNone)
|
||||
@ -70,7 +70,7 @@ func init() {
|
||||
flags.Uint64VarP(
|
||||
&setFlags.Memory,
|
||||
memoryFlagName, "m", 0,
|
||||
"Memory in MB",
|
||||
"Memory in MiB",
|
||||
)
|
||||
_ = setCmd.RegisterFlagCompletionFunc(memoryFlagName, completion.AutocompleteNone)
|
||||
|
||||
|
Reference in New Issue
Block a user