Skip to content

Commit 687eb9b

Browse files
committed
bugfix: make sure to create dir for os images
1 parent 618878a commit 687eb9b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cloud/services/compute/instance/image.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ func (s *Service) setCloudImage(ctx context.Context) error {
5555
// download image
5656
ok, _ := isChecksumOK(vnc, image, rawImageFilePath)
5757
if !ok { // if checksum is ok, it means the image is already there. skip installing
58+
out, _, err := vnc.Exec(ctx, fmt.Sprintf("mkdir -p %s && mkdir -p %s", etcCAPPX, rawImageDirPath))
59+
if err != nil {
60+
return errors.Errorf("failed to create dir %s: %s : %v", rawImageDirPath, out, err)
61+
}
5862
log.Info("downloading node image. this will take few mins.")
59-
out, _, err := vnc.Exec(ctx, fmt.Sprintf("wget %s -O %s", image.URL, rawImageFilePath))
63+
out, _, err = vnc.Exec(ctx, fmt.Sprintf("wget %s -O %s", image.URL, rawImageFilePath))
6064
if err != nil {
6165
return errors.Errorf("failed to download image: %s : %v", out, err)
6266
}

0 commit comments

Comments
 (0)