distro: set dir / file BP customizations in OS customizations
Hook up the custom BP directories and files implementation with OS pipeline implementation. The user-provided values are now set in the OS customizations structure and will be used by the OS pipeline generator when adding stages to the pipeline. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
4e2b369acf
commit
b98f5dad70
4 changed files with 61 additions and 0 deletions
|
|
@ -129,6 +129,21 @@ func osCustomizations(
|
|||
)
|
||||
}
|
||||
|
||||
var err error
|
||||
osc.Directories, err = blueprint.DirectoryCustomizationsToFsNodeDirectories(c.GetDirectories())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint directory customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert directory customizations to fs node directories: %v", err))
|
||||
}
|
||||
|
||||
osc.Files, err = blueprint.FileCustomizationsToFsNodeFiles(c.GetFiles())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint file customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert file customizations to fs node files: %v", err))
|
||||
}
|
||||
|
||||
osc.Grub2Config = imageConfig.Grub2Config
|
||||
osc.Sysconfig = imageConfig.Sysconfig
|
||||
osc.SystemdLogind = imageConfig.SystemdLogind
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package rhel7
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
|
|
@ -141,6 +142,21 @@ func osCustomizations(
|
|||
osc.FactAPIType = options.Facts.ApiType
|
||||
}
|
||||
|
||||
var err error
|
||||
osc.Directories, err = blueprint.DirectoryCustomizationsToFsNodeDirectories(c.GetDirectories())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint directory customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert directory customizations to fs node directories: %v", err))
|
||||
}
|
||||
|
||||
osc.Files, err = blueprint.FileCustomizationsToFsNodeFiles(c.GetFiles())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint file customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert file customizations to fs node files: %v", err))
|
||||
}
|
||||
|
||||
osc.Grub2Config = imageConfig.Grub2Config
|
||||
osc.Sysconfig = imageConfig.Sysconfig
|
||||
osc.SystemdLogind = imageConfig.SystemdLogind
|
||||
|
|
|
|||
|
|
@ -148,6 +148,21 @@ func osCustomizations(
|
|||
osc.FactAPIType = options.Facts.ApiType
|
||||
}
|
||||
|
||||
var err error
|
||||
osc.Directories, err = blueprint.DirectoryCustomizationsToFsNodeDirectories(c.GetDirectories())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint directory customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert directory customizations to fs node directories: %v", err))
|
||||
}
|
||||
|
||||
osc.Files, err = blueprint.FileCustomizationsToFsNodeFiles(c.GetFiles())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint file customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert file customizations to fs node files: %v", err))
|
||||
}
|
||||
|
||||
osc.Grub2Config = imageConfig.Grub2Config
|
||||
osc.Sysconfig = imageConfig.Sysconfig
|
||||
osc.SystemdLogind = imageConfig.SystemdLogind
|
||||
|
|
|
|||
|
|
@ -145,6 +145,21 @@ func osCustomizations(
|
|||
osc.FactAPIType = options.Facts.ApiType
|
||||
}
|
||||
|
||||
var err error
|
||||
osc.Directories, err = blueprint.DirectoryCustomizationsToFsNodeDirectories(c.GetDirectories())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint directory customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert directory customizations to fs node directories: %v", err))
|
||||
}
|
||||
|
||||
osc.Files, err = blueprint.FileCustomizationsToFsNodeFiles(c.GetFiles())
|
||||
if err != nil {
|
||||
// In theory this should never happen, because the blueprint file customizations
|
||||
// should have been validated before this point.
|
||||
panic(fmt.Sprintf("failed to convert file customizations to fs node files: %v", err))
|
||||
}
|
||||
|
||||
osc.Grub2Config = imageConfig.Grub2Config
|
||||
osc.Sysconfig = imageConfig.Sysconfig
|
||||
osc.SystemdLogind = imageConfig.SystemdLogind
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue