Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 980dcd0

Browse files
author
Micah Young
committed
Fix stemcells with non-standard OVF names
- Stemcells from stembuild have OVFs named stembuild_target.ovf instead of image.ovf
1 parent a30c288 commit 980dcd0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bosh-vmrun-cpi/stemcell/client.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ func (c StemcellClientImpl) ExtractOvf(stemcellTarballPath string) (string, erro
3737
return "", bosherr.WrapErrorf(err, "Unpacking outer stemcell tarball '%s' to '%s'", stemcellTarballPath, c.parentTempDir)
3838
}
3939

40-
imageOvfPath := filepath.Join(c.parentTempDir, "image.ovf")
41-
if !c.fs.FileExists(imageOvfPath) {
42-
return "", bosherr.Error("stemcell does not contain 'image.ovf'")
40+
matches, err := filepath.Glob(filepath.Join(c.parentTempDir, "*.ovf"))
41+
if err != nil {
42+
return "", err
43+
}
44+
45+
if len(matches) != 1 {
46+
return "", bosherr.Error("stemcell does not contain a single ovf")
4347
}
4448

45-
return imageOvfPath, nil
49+
return matches[0], nil
4650
}
4751

4852
func (c StemcellClientImpl) Cleanup() {

0 commit comments

Comments
 (0)