Skip to content

Commit 1e81c62

Browse files
committed
handle first disk initialize
Signed-off-by: Songpon Srisawai <songpon.ssw@gmail.com>
1 parent 4657916 commit 1e81c62

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/instance/start.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,19 @@ func ShowMessage(inst *store.Instance) error {
389389
}
390390

391391
// prepareDiffDisk checks the disk size difference between inst.Disk and yaml.Disk.
392+
// If there is no diffDisk, return nil (the instance has not been initialized or started yet).
392393
func prepareDiffDisk(inst *store.Instance) error {
393394
diffDisk := filepath.Join(inst.Dir, filenames.DiffDisk)
394395

396+
// Handle the instance initialzation
397+
_, err := os.Stat(diffDisk)
398+
if err != nil {
399+
if os.IsNotExist(err) {
400+
return nil
401+
}
402+
return err
403+
}
404+
395405
f, err := os.Open(diffDisk)
396406
if err != nil {
397407
return err

0 commit comments

Comments
 (0)