debian-forge-composer/vendor/github.com/osbuild/images/pkg/manifest/ovf.go
Achilleas Koutsou d4332f85d3 deps: update osbuild/images to v0.3.0
Bump the required osbuild version to v93 (due to the systemd units
change).

Pin the new osbuild version in Schutzfile.

Update repo snapshots in Schutzfile due to osbuild v93 depending on
new selinux-policy build.
2023-08-24 20:30:24 +02:00

52 lines
1.1 KiB
Go

package manifest
import (
"fmt"
"github.com/osbuild/images/pkg/osbuild"
)
// A OVF copies a vmdk image to it's own tree and generates an OVF descriptor
type OVF struct {
Base
imgPipeline *VMDK
}
// NewOVF creates a new OVF pipeline. imgPipeline is the pipeline producing the vmdk image.
func NewOVF(buidPipeline *Build, imgPipeline *VMDK) *OVF {
p := &OVF{
Base: NewBase(imgPipeline.Manifest(), "ovf", buidPipeline),
imgPipeline: imgPipeline,
}
buidPipeline.addDependent(p)
imgPipeline.Manifest().addPipeline(p)
return p
}
func (p *OVF) serialize() osbuild.Pipeline {
pipeline := p.Base.serialize()
inputName := "vmdk-tree"
pipeline.AddStage(osbuild.NewCopyStageSimple(
&osbuild.CopyStageOptions{
Paths: []osbuild.CopyStagePath{
{
From: fmt.Sprintf("input://%s/%s", inputName, p.imgPipeline.Export().Filename()),
To: "tree:///",
},
},
},
osbuild.NewPipelineTreeInputs(inputName, p.imgPipeline.Name()),
))
pipeline.AddStage(osbuild.NewOVFStage(&osbuild.OVFStageOptions{
Vmdk: p.imgPipeline.Filename(),
}))
return pipeline
}
func (p *OVF) getBuildPackages(Distro) []string {
return []string{"qemu-img"}
}