mirror of
https://github.com/containers/podman.git
synced 2025-05-22 01:27:07 +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(
|
flags.Uint64Var(
|
||||||
&initOpts.DiskSize,
|
&initOpts.DiskSize,
|
||||||
diskSizeFlagName, cfg.ContainersConfDefaultsRO.Machine.DiskSize,
|
diskSizeFlagName, cfg.ContainersConfDefaultsRO.Machine.DiskSize,
|
||||||
"Disk size in GB",
|
"Disk size in GiB",
|
||||||
)
|
)
|
||||||
|
|
||||||
_ = initCmd.RegisterFlagCompletionFunc(diskSizeFlagName, completion.AutocompleteNone)
|
_ = initCmd.RegisterFlagCompletionFunc(diskSizeFlagName, completion.AutocompleteNone)
|
||||||
@ -70,7 +70,7 @@ func init() {
|
|||||||
flags.Uint64VarP(
|
flags.Uint64VarP(
|
||||||
&initOpts.Memory,
|
&initOpts.Memory,
|
||||||
memoryFlagName, "m", cfg.ContainersConfDefaultsRO.Machine.Memory,
|
memoryFlagName, "m", cfg.ContainersConfDefaultsRO.Machine.Memory,
|
||||||
"Memory in MB",
|
"Memory in MiB",
|
||||||
)
|
)
|
||||||
_ = initCmd.RegisterFlagCompletionFunc(memoryFlagName, completion.AutocompleteNone)
|
_ = 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.Created = units.HumanDuration(time.Since(vm.CreatedAt)) + " ago"
|
||||||
response.VMType = vm.VMType
|
response.VMType = vm.VMType
|
||||||
response.CPUs = vm.CPUs
|
response.CPUs = vm.CPUs
|
||||||
response.Memory = units.HumanSize(float64(vm.Memory))
|
response.Memory = units.BytesSize(float64(vm.Memory))
|
||||||
response.DiskSize = units.HumanSize(float64(vm.DiskSize))
|
response.DiskSize = units.BytesSize(float64(vm.DiskSize))
|
||||||
|
|
||||||
humanResponses = append(humanResponses, response)
|
humanResponses = append(humanResponses, response)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ func init() {
|
|||||||
flags.Uint64Var(
|
flags.Uint64Var(
|
||||||
&setFlags.DiskSize,
|
&setFlags.DiskSize,
|
||||||
diskSizeFlagName, 0,
|
diskSizeFlagName, 0,
|
||||||
"Disk size in GB",
|
"Disk size in GiB",
|
||||||
)
|
)
|
||||||
|
|
||||||
_ = setCmd.RegisterFlagCompletionFunc(diskSizeFlagName, completion.AutocompleteNone)
|
_ = setCmd.RegisterFlagCompletionFunc(diskSizeFlagName, completion.AutocompleteNone)
|
||||||
@ -70,7 +70,7 @@ func init() {
|
|||||||
flags.Uint64VarP(
|
flags.Uint64VarP(
|
||||||
&setFlags.Memory,
|
&setFlags.Memory,
|
||||||
memoryFlagName, "m", 0,
|
memoryFlagName, "m", 0,
|
||||||
"Memory in MB",
|
"Memory in MiB",
|
||||||
)
|
)
|
||||||
_ = setCmd.RegisterFlagCompletionFunc(memoryFlagName, completion.AutocompleteNone)
|
_ = setCmd.RegisterFlagCompletionFunc(memoryFlagName, completion.AutocompleteNone)
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ Number of CPUs.
|
|||||||
|
|
||||||
#### **--disk-size**=*number*
|
#### **--disk-size**=*number*
|
||||||
|
|
||||||
Size of the disk for the guest VM in GB.
|
Size of the disk for the guest VM in GiB.
|
||||||
|
|
||||||
#### **--help**
|
#### **--help**
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ Defaults to `testing`.
|
|||||||
|
|
||||||
#### **--memory**, **-m**=*number*
|
#### **--memory**, **-m**=*number*
|
||||||
|
|
||||||
Memory (in MB).
|
Memory (in MiB). Note: 1024MiB = 1GiB.
|
||||||
|
|
||||||
#### **--now**
|
#### **--now**
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ import (
|
|||||||
type initMachine struct {
|
type initMachine struct {
|
||||||
/*
|
/*
|
||||||
--cpus uint Number of CPUs (default 1)
|
--cpus uint Number of CPUs (default 1)
|
||||||
--disk-size uint Disk size in GB (default 100)
|
--disk-size uint Disk size in GiB (default 100)
|
||||||
--ignition-path string Path to ignition file
|
--ignition-path string Path to ignition file
|
||||||
--username string Username of the remote user (default "core" for FCOS, "user" for Fedora)
|
--username string Username of the remote user (default "core" for FCOS, "user" for Fedora)
|
||||||
--image-path string Path to bootable image (default "testing")
|
--image-path string Path to bootable image (default "testing")
|
||||||
-m, --memory uint Memory in MB (default 2048)
|
-m, --memory uint Memory in MiB (default 2048)
|
||||||
--now Start machine now
|
--now Start machine now
|
||||||
--rootful Whether this machine should prefer rootful container execution
|
--rootful Whether this machine should prefer rootful container execution
|
||||||
--timezone string Set timezone (default "local")
|
--timezone string Set timezone (default "local")
|
||||||
|
Reference in New Issue
Block a user