image: xz compress a pipeline if the image specifies it
If an image specifies xz compression, add an xz pipeline to the end of the manifest.
This commit is contained in:
parent
631b133352
commit
6fed422972
1 changed files with 10 additions and 2 deletions
|
|
@ -21,6 +21,7 @@ type LiveImage struct {
|
|||
Environment environment.Environment
|
||||
Workload workload.Workload
|
||||
Filename string
|
||||
Compression string
|
||||
}
|
||||
|
||||
func NewLiveImage() *LiveImage {
|
||||
|
|
@ -47,8 +48,15 @@ func (img *LiveImage) InstantiateManifest(m *manifest.Manifest,
|
|||
var artifact *artifact.Artifact
|
||||
switch img.Platform.GetImageFormat() {
|
||||
case platform.FORMAT_RAW:
|
||||
imagePipeline.Filename = img.Filename
|
||||
artifact = imagePipeline.Export()
|
||||
switch img.Compression {
|
||||
case "xz":
|
||||
xzPipeline := manifest.NewXZ(m, buildPipeline, imagePipeline)
|
||||
xzPipeline.Filename = img.Filename
|
||||
artifact = xzPipeline.Export()
|
||||
default:
|
||||
imagePipeline.Filename = img.Filename
|
||||
artifact = imagePipeline.Export()
|
||||
}
|
||||
case platform.FORMAT_QCOW2:
|
||||
qcow2Pipeline := manifest.NewQCOW2(m, buildPipeline, imagePipeline)
|
||||
qcow2Pipeline.Filename = img.Filename
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue