image: handle the GCE format in the live image
Add the options required by GCE to a tar pipeline at the end of the manifest for images defined on the GCE format.
This commit is contained in:
parent
8c361e510d
commit
f0e29ab697
1 changed files with 11 additions and 0 deletions
|
|
@ -4,9 +4,11 @@ import (
|
|||
"math/rand"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/artifact"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/disk"
|
||||
"github.com/osbuild/osbuild-composer/internal/environment"
|
||||
"github.com/osbuild/osbuild-composer/internal/manifest"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
"github.com/osbuild/osbuild-composer/internal/platform"
|
||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/runner"
|
||||
|
|
@ -76,6 +78,15 @@ func (img *LiveImage) InstantiateManifest(m *manifest.Manifest,
|
|||
}
|
||||
artifactPipeline = vmdkPipeline
|
||||
artifact = vmdkPipeline.Export()
|
||||
case platform.FORMAT_GCE:
|
||||
archivePipeline := manifest.NewTar(m, buildPipeline, imagePipeline, "archive")
|
||||
archivePipeline.Format = osbuild.TarArchiveFormatOldgnu
|
||||
archivePipeline.RootNode = osbuild.TarRootNodeOmit
|
||||
// these are required to successfully import the image to GCP
|
||||
archivePipeline.ACLs = common.BoolToPtr(false)
|
||||
archivePipeline.SELinux = common.BoolToPtr(false)
|
||||
archivePipeline.Xattrs = common.BoolToPtr(false)
|
||||
archivePipeline.Filename = img.Filename // filename extension will determine compression
|
||||
default:
|
||||
panic("invalid image format for image kind")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue