Skip to content

Commit

Permalink
disk(ova): ovf descriptor must be the first file in the ova
Browse files Browse the repository at this point in the history
RHEL-22199
  • Loading branch information
croissanne authored and achilleas-k committed Feb 8, 2024
1 parent 58e2a3b commit 1709a76
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/image/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package image
import (
"fmt"
"math/rand"
"path/filepath"
"strings"

"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/environment"
Expand Down Expand Up @@ -87,8 +89,14 @@ func (img *DiskImage) InstantiateManifest(m *manifest.Manifest,
ovfPipeline := manifest.NewOVF(buildPipeline, vmdkPipeline)
tarPipeline := manifest.NewTar(buildPipeline, ovfPipeline, "archive")
tarPipeline.Format = osbuild.TarArchiveFormatUstar
tarPipeline.RootNode = osbuild.TarRootNodeOmit
tarPipeline.SetFilename(img.Filename)
extLess := strings.TrimSuffix(img.Filename, filepath.Ext(img.Filename))
// The .ovf descriptor needs to be the first file in the archive
tarPipeline.Paths = []string{
fmt.Sprintf("%s.ovf", extLess),
fmt.Sprintf("%s.mf", extLess),
fmt.Sprintf("%s.vmdk", extLess),
}
imagePipeline = tarPipeline
case platform.FORMAT_GCE:
// NOTE(akoutsou): temporary workaround; filename required for GCP
Expand Down

0 comments on commit 1709a76

Please sign in to comment.