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 authored and vrothberg committed Sep 27, 2021
1 parent 5a2ca77 commit 3600054
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 @@ -42,15 +42,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 @@ -59,7 +59,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 3600054

Please sign in to comment.