diff --git a/pkg/manifest/raw_bootc.go b/pkg/manifest/raw_bootc.go index a5414d0459..39b92e6f68 100644 --- a/pkg/manifest/raw_bootc.go +++ b/pkg/manifest/raw_bootc.go @@ -210,11 +210,22 @@ func (p *RawBootcImage) serialize() osbuild.Pipeline { // First create custom directories, because some of the custom files may depend on them if len(p.Directories) > 0 { - pipeline.AddStages(osbuild.GenDirectoryNodesStages(p.Directories)...) + + stages := osbuild.GenDirectoryNodesStages(p.Directories) + for _, stage := range stages { + stage.Mounts = mounts + stage.Devices = devices + } + pipeline.AddStages(stages...) } if len(p.Files) > 0 { - pipeline.AddStages(osbuild.GenFileNodesStages(p.Files)...) + stages := osbuild.GenFileNodesStages(p.Files) + for _, stage := range stages { + stage.Mounts = mounts + stage.Devices = devices + } + pipeline.AddStages(stages...) } // XXX: maybe go back to adding this conditionally when we stop diff --git a/pkg/manifest/raw_bootc_test.go b/pkg/manifest/raw_bootc_test.go index c1799d9327..7327ddea70 100644 --- a/pkg/manifest/raw_bootc_test.go +++ b/pkg/manifest/raw_bootc_test.go @@ -315,6 +315,7 @@ func TestRawBootcImageSerializeCreateFilesDirs(t *testing.T) { require.NotNil(t, mkdirStage) mkdirOptions := mkdirStage.Options.(*osbuild.MkdirStageOptions) assert.Equal(t, "/path/to/dir", mkdirOptions.Paths[0].Path) + assertBootcDeploymentAndBindMount(t, mkdirStage) } else { assert.Nil(t, mkdirStage) } @@ -326,6 +327,7 @@ func TestRawBootcImageSerializeCreateFilesDirs(t *testing.T) { require.NotNil(t, copyStage) copyOptions := copyStage.Options.(*osbuild.CopyStageOptions) assert.Equal(t, "tree:///path/to/file", copyOptions.Paths[0].To) + assertBootcDeploymentAndBindMount(t, copyStage) } else { assert.Nil(t, copyStage) }