Skip to content

Commit

Permalink
Fix vch imagestore deletion (#8615)
Browse files Browse the repository at this point in the history
In VC 7.0, datastore path changes, so we need to
add a new condition.
  • Loading branch information
wjun authored Feb 5, 2020
1 parent e5db4d1 commit 9becae4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/install/management/store_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ func (d *Dispatcher) deleteImages(conf *config.VirtualContainerHostConfigSpec, v
continue
}

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

Expand Down

0 comments on commit 9becae4

Please sign in to comment.