Skip to content

Commit

Permalink
Allow machine options to be set from containers.conf
Browse files Browse the repository at this point in the history
CPUS, memory, disk size, and image path defaults can be set from
[machine] table in containers.conf

[NO TESTS NEEDED]

Signed-off-by: Ashley Cui <[email protected]>
  • Loading branch information
ashley-cui committed Sep 27, 2021
1 parent be961c7 commit 0c2183d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/podman/machine/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ func init() {
cpusFlagName := "cpus"
flags.Uint64Var(
&initOpts.CPUS,
cpusFlagName, 1,
cpusFlagName, cfg.Machine.CPUs,
"Number of CPUs",
)
_ = initCmd.RegisterFlagCompletionFunc(cpusFlagName, completion.AutocompleteNone)

diskSizeFlagName := "disk-size"
flags.Uint64Var(
&initOpts.DiskSize,
diskSizeFlagName, 10,
diskSizeFlagName, cfg.Machine.DiskSize,
"Disk size in GB",
)

Expand All @@ -56,7 +56,7 @@ func init() {
memoryFlagName := "memory"
flags.Uint64VarP(
&initOpts.Memory,
memoryFlagName, "m", 2048,
memoryFlagName, "m", cfg.Machine.Memory,
"Memory in MB",
)
_ = initCmd.RegisterFlagCompletionFunc(memoryFlagName, completion.AutocompleteNone)
Expand Down

0 comments on commit 0c2183d

Please sign in to comment.