osbuild: add new org.osbuild.skopeo stage

Add bindings for the `org.osbuild.skopeo` that can be used to copy
container images, accessed via the `org.osbuild.containers` input,
into images.
The constructor is designed with ease of use in mind and takes
the needed container inputs and the storage path option, i.e.
where to store the container in the images.
This commit is contained in:
Christian Kellner 2022-07-18 15:14:37 +02:00 committed by Ondřej Budai
parent 718b0c0c32
commit f8804358a4

View file

@ -0,0 +1,31 @@
package osbuild
type SkopeoDestination struct {
Type string `json:"type"`
StoragePath string `json:"storage-path,omitempty"`
StorageDriver string `json:"sotrage-driver,omitempty"`
}
type SkopeoStageOptions struct {
Destination SkopeoDestination `json:"destination"`
}
func (o SkopeoStageOptions) isStageOptions() {}
func NewSkopeoStage(images ContainersInput, path string) *Stage {
inputs := ContainersInputs{
"images": images,
}
return &Stage{
Type: "org.osbuild.skopeo",
Options: &SkopeoStageOptions{
Destination: SkopeoDestination{
Type: "containers-storage",
StoragePath: path,
},
},
Inputs: inputs,
}
}