Skip to content

Commit

Permalink
#11 allow multipe .vmdk files to be added to the final ova (ubuntu/fo…
Browse files Browse the repository at this point in the history
…cal64 is multi vmdk image)
  • Loading branch information
mhewedy committed Aug 21, 2020
1 parent 1a3d748 commit 3ec070a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vagrant/process_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ func createOVAFile(imagePath, imageDir string) error {
if err != nil {
return err
}
var ovaFileInfo, vmdkFileInfo os.FileInfo
var ovaFileInfo os.FileInfo
vmdkFileInfos := make([]os.FileInfo, 0)
for _, info := range infos {
if strings.HasSuffix(info.Name(), ".ovf") {
ovaFileInfo = info
}
if strings.HasSuffix(info.Name(), ".vmdk") {
vmdkFileInfo = info
vmdkFileInfos = append(vmdkFileInfos, info)
}
}

Expand All @@ -77,5 +78,5 @@ func createOVAFile(imagePath, imageDir string) error {
}
defer file.Close()

return tarFiles(file, imageDir, []os.FileInfo{ovaFileInfo, vmdkFileInfo})
return tarFiles(file, imageDir, append(vmdkFileInfos, ovaFileInfo))
}

0 comments on commit 3ec070a

Please sign in to comment.