From bca3f72657d26cdbe68de1ec243388ecb4ee0e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Fri, 10 Feb 2023 12:49:02 +0100 Subject: [PATCH] image/ostree-raw: pass directories and files customization to pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the `OSTreeRawImage` with a slice of custom directories and files, that can be created in the image. Pass these down to the ostree deployment pipeline, so that it can add necessary osbuld stages if any directories or files were specified by user. Signed-off-by: Tomáš Hozza --- internal/image/ostree_raw.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/image/ostree_raw.go b/internal/image/ostree_raw.go index 84a3bd49e..53f8fb4ff 100644 --- a/internal/image/ostree_raw.go +++ b/internal/image/ostree_raw.go @@ -5,6 +5,7 @@ import ( "github.com/osbuild/osbuild-composer/internal/artifact" "github.com/osbuild/osbuild-composer/internal/disk" + "github.com/osbuild/osbuild-composer/internal/fsnode" "github.com/osbuild/osbuild-composer/internal/manifest" "github.com/osbuild/osbuild-composer/internal/ostree" "github.com/osbuild/osbuild-composer/internal/platform" @@ -38,6 +39,9 @@ type OSTreeRawImage struct { Filename string Ignition bool + + Directories []*fsnode.Directory + Files []*fsnode.File } func NewOSTreeRawImage(commit ostree.CommitSpec) *OSTreeRawImage { @@ -57,6 +61,8 @@ func ostreeCompressedImagePipelines(img *OSTreeRawImage, m *manifest.Manifest, b osPipeline.Users = img.Users osPipeline.Groups = img.Groups osPipeline.SysrootReadOnly = img.SysrootReadOnly + osPipeline.Directories = img.Directories + osPipeline.Files = img.Files imagePipeline := manifest.NewRawOStreeImage(m, buildPipeline, img.Platform, osPipeline)