From c95072d686d7d76339c272a3aa23e4d987389d4c Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Fri, 17 Mar 2023 13:25:07 +0100 Subject: [PATCH] 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. --- internal/manifest/os.go | 2 +- internal/osbuild/skopeo_stage.go | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/manifest/os.go b/internal/manifest/os.go index f81297b50..5837efcfb 100644 --- a/internal/manifest/os.go +++ b/internal/manifest/os.go @@ -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) } diff --git a/internal/osbuild/skopeo_stage.go b/internal/osbuild/skopeo_stage.go index c0ac14fbd..7efa70ba9 100644 --- a/internal/osbuild/skopeo_stage.go +++ b/internal/osbuild/skopeo_stage.go @@ -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{