osbuild: add manifest-lists input to skopeo stage

The skopeo stage in osbuild supports an second optional set of inputs
called `manifest-lists`.  This is an array of files, i.e.,
`org.osbuild.files` type input.

To support this we need a new type for the skopeo stage inputs that can
encompass both input types, images and manifest-lists.
This commit is contained in:
Achilleas Koutsou 2023-03-17 13:25:07 +01:00
parent dfae9fbefb
commit c95072d686
2 changed files with 12 additions and 4 deletions

View file

@ -352,7 +352,7 @@ func (p *OS) serialize() osbuild.Pipeline {
pipeline.AddStage(osbuild.NewContainersStorageConfStage(containerStoreOpts))
}
skopeo := osbuild.NewSkopeoStage(storagePath, images)
skopeo := osbuild.NewSkopeoStage(storagePath, images, nil)
pipeline.AddStage(skopeo)
}

View file

@ -12,10 +12,18 @@ type SkopeoStageOptions struct {
func (o SkopeoStageOptions) isStageOptions() {}
func NewSkopeoStage(path string, images ContainersInput) *Stage {
type SkopeoStageInputs struct {
Images ContainersInput `json:"images"`
ManifestLists *FilesInput `json:"manifest-lists,omitempty"`
}
inputs := ContainersInputs{
"images": images,
func (SkopeoStageInputs) isStageInputs() {}
func NewSkopeoStage(path string, images ContainersInput, manifests *FilesInput) *Stage {
inputs := SkopeoStageInputs{
Images: images,
ManifestLists: manifests,
}
return &Stage{