mirror of
https://github.com/containers/podman.git
synced 2026-06-06 23:05:52 -04:00
hyperV: fix powershell path escape
To avoid special chars from being interpreted. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -694,10 +694,11 @@ func (h HyperVStubber) UpdateSSHPort(_ *vmconfigs.MachineConfig, _ int) error {
|
||||
}
|
||||
|
||||
func resizeDisk(newSize strongunits.GiB, imagePath *define.VMFile) error {
|
||||
resize := exec.Command("powershell", []string{"-command", fmt.Sprintf("Resize-VHD \"%s\" %d", imagePath.GetPath(), newSize.ToBytes())}...)
|
||||
resize := exec.Command("powershell", "-command", fmt.Sprintf("Resize-VHD \"$ENV:IMAGE_PATH\" %d", newSize.ToBytes()))
|
||||
logrus.Debug(resize.Args)
|
||||
resize.Stdout = os.Stdout
|
||||
resize.Stderr = os.Stderr
|
||||
resize.Env = append(os.Environ(), "IMAGE_PATH="+imagePath.GetPath())
|
||||
if err := resize.Run(); err != nil {
|
||||
return fmt.Errorf("resizing image: %q", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user