Skip to content

Commit 9becae4

Browse files
authored
Fix vch imagestore deletion (#8615)
In VC 7.0, datastore path changes, so we need to add a new condition.
1 parent e5db4d1 commit 9becae4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/install/management/store_files.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ func (d *Dispatcher) deleteImages(conf *config.VirtualContainerHostConfigSpec, v
8888
continue
8989
}
9090

91-
if len(children) == 1 { // when image store path is given, we need to delete VIC dir too when it is empty.
91+
if len(children) == 1 || len(children) == 0 { // when image store path is given, we need to delete VIC dir too when it is empty.
9292
d.op.Debugf("Removing empty image store parent directory [%s] %s", imageDir.Host, imageDir.Path)
9393
if _, err = d.deleteDatastoreFiles(imageDSes[0], imageDir.Path, true); err != nil {
9494
errs = append(errs, err.Error())
9595
}
9696
} else {
97-
d.op.Debug("Image store parent directory not empty, leaving in place. Still contains the following entries: %q", strings.Join(children, ", "))
97+
d.op.Debugf("Image store parent directory not empty, leaving in place. Still contains the following entries: %q", strings.Join(children, ", "))
9898
}
9999
}
100100

0 commit comments

Comments
 (0)