From 699720735250892eb0ec496808cacb7bd86484b8 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 12 Jul 2024 10:28:47 +0200 Subject: [PATCH] fix disk size unit --- pkg/machinedriver/driver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/machinedriver/driver.go b/pkg/machinedriver/driver.go index c427b88c..0211d594 100644 --- a/pkg/machinedriver/driver.go +++ b/pkg/machinedriver/driver.go @@ -21,6 +21,7 @@ import ( "log/slog" "os" + "github.com/containers/common/pkg/strongunits" "github.com/containers/podman/v5/pkg/machine" "github.com/containers/podman/v5/pkg/machine/define" "github.com/containers/podman/v5/pkg/machine/env" @@ -121,7 +122,7 @@ func (d *Driver) initOpts() *define.InitOptions { initOpts.Name = d.MachineName initOpts.CPUS = uint64(d.VMDriver.CPU) - initOpts.DiskSize = d.VMDriver.DiskCapacity + initOpts.DiskSize = uint64(strongunits.ToGiB(strongunits.B(d.VMDriver.DiskCapacity))) initOpts.Memory = uint64(d.VMDriver.Memory) initOpts.TimeZone = "" initOpts.ReExec = false