Skip to content

Commit c722f2f

Browse files
committed
Validate memory on every init, not only with --memory
The default memory value is sourced from `containers.conf`, it could be misconfigured. Signed-off-by: Jan Rodák <hony.com@seznam.cz>
1 parent bb4dda4 commit c722f2f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

cmd/podman/machine/init.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,8 @@ func initMachine(cmd *cobra.Command, args []string) error {
253253
initOpts.UserModeNetworking = &initOptionalFlags.UserModeNetworking
254254
}
255255

256-
if cmd.Flags().Changed("memory") {
257-
if err := checkMaxMemory(strongunits.MiB(initOpts.Memory)); err != nil {
258-
return err
259-
}
256+
if err := checkMaxMemory(strongunits.MiB(initOpts.Memory)); err != nil {
257+
return err
260258
}
261259
if err := checkMaxCPUs(initOpts.CPUS); err != nil {
262260
return err

0 commit comments

Comments
 (0)