RHEL-85: don't pass blueprint package set separately to pipelines
Blueprint package set is now depsolved together with the OS package set in a chain. The result is stored in the package specs sets under the OS package set name. In reality, the code was able to handle a `nil` package specs to be passed to pipelines, however some parts were looking for the kernel version in the blueprint package specs, which would be a bug. Regenerated affected image test cases.
This commit is contained in:
parent
800ac5fe0b
commit
4c707663f2
34 changed files with 1613 additions and 74238 deletions
|
|
@ -231,6 +231,17 @@ func GetTestingPackageSpecSets(packageName, arch string, pkgSetNames []string) m
|
||||||
return testPackageSpecSets
|
return testPackageSpecSets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetTestingImagePackageSpecSets returns PackageSpecSets for all package sets
|
||||||
|
// defined by the provided ImageType, which is useful for unit testing.
|
||||||
|
func GetTestingImagePackageSpecSets(packageName string, i distro.ImageType) map[string][]rpmmd.PackageSpec {
|
||||||
|
arch := i.Arch().Name()
|
||||||
|
imagePackageSets := make([]string, 0, len(i.PackageSets(blueprint.Blueprint{})))
|
||||||
|
for pkgSetName := range i.PackageSets(blueprint.Blueprint{}) {
|
||||||
|
imagePackageSets = append(imagePackageSets, pkgSetName)
|
||||||
|
}
|
||||||
|
return GetTestingPackageSpecSets(packageName, arch, imagePackageSets)
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that all package sets defined in the package set chains are defined for the image type
|
// Ensure that all package sets defined in the package set chains are defined for the image type
|
||||||
func TestImageType_PackageSetsChains(t *testing.T, d distro.Distro) {
|
func TestImageType_PackageSetsChains(t *testing.T, d distro.Distro) {
|
||||||
distroName := d.Name()
|
distroName := d.Name()
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,7 @@ func TestDistro_ManifestError(t *testing.T) {
|
||||||
imgOpts := distro.ImageOptions{
|
imgOpts := distro.ImageOptions{
|
||||||
Size: imgType.Size(0),
|
Size: imgType.Size(0),
|
||||||
}
|
}
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, imgOpts, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, imgOpts, nil, testPackageSpecSets, 0)
|
||||||
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
||||||
assert.EqualError(t, err, "kernel boot parameter customizations are not supported for ostree types")
|
assert.EqualError(t, err, "kernel boot parameter customizations are not supported for ostree types")
|
||||||
|
|
@ -601,7 +601,7 @@ func TestDistro_CustomFileSystemManifestError(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
||||||
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
||||||
|
|
@ -630,7 +630,7 @@ func TestDistro_TestRootMountPoint(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
||||||
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
||||||
|
|
@ -663,7 +663,7 @@ func TestDistro_CustomFileSystemSubDirectories(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
if strings.HasPrefix(imgTypeName, "edge-") {
|
if strings.HasPrefix(imgTypeName, "edge-") {
|
||||||
continue
|
continue
|
||||||
|
|
@ -702,7 +702,7 @@ func TestDistro_MountpointsWithArbitraryDepthAllowed(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
layout := imgType.PartitionType()
|
layout := imgType.PartitionType()
|
||||||
if layout == "" || strings.HasPrefix(imgTypeName, "edge-") {
|
if layout == "" || strings.HasPrefix(imgTypeName, "edge-") {
|
||||||
|
|
@ -740,7 +740,7 @@ func TestDistro_DirtyMountpointsNotAllowed(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
if strings.HasPrefix(imgTypeName, "edge-") {
|
if strings.HasPrefix(imgTypeName, "edge-") {
|
||||||
continue
|
continue
|
||||||
|
|
@ -771,7 +771,7 @@ func TestDistro_CustomFileSystemPatternMatching(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
||||||
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
||||||
|
|
@ -800,7 +800,7 @@ func TestDistro_CustomUsrPartitionNotLargeEnough(t *testing.T) {
|
||||||
arch, _ := r8distro.GetArch(archName)
|
arch, _ := r8distro.GetArch(archName)
|
||||||
for _, imgTypeName := range arch.ListImageTypes() {
|
for _, imgTypeName := range arch.ListImageTypes() {
|
||||||
imgType, _ := arch.GetImageType(imgTypeName)
|
imgType, _ := arch.GetImageType(imgTypeName)
|
||||||
testPackageSpecSets := distro_test_common.GetTestingPackageSpecSets("kernel", arch.Name(), imgType.PayloadPackageSets())
|
testPackageSpecSets := distro_test_common.GetTestingImagePackageSpecSets("kernel", imgType)
|
||||||
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
_, err := imgType.Manifest(bp.Customizations, distro.ImageOptions{}, nil, testPackageSpecSets, 0)
|
||||||
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
if imgTypeName == "edge-commit" || imgTypeName == "edge-container" {
|
||||||
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
assert.EqualError(t, err, "Custom mountpoints are not supported for ostree types")
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ func qcow2Pipelines(t *imageType, customizations *blueprint.Customizations, opti
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
|
|
||||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options)
|
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], customizations, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +46,7 @@ func qcow2Pipelines(t *imageType, customizations *blueprint.Customizations, opti
|
||||||
}
|
}
|
||||||
|
|
||||||
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[blueprintPkgsKey], customizations.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||||
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
||||||
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
||||||
pipelines = append(pipelines, *treePipeline)
|
pipelines = append(pipelines, *treePipeline)
|
||||||
|
|
@ -76,7 +76,7 @@ func prependKernelCmdlineStage(pipeline *osbuild.Pipeline, t *imageType, pt *dis
|
||||||
func vhdPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
func vhdPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options)
|
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], customizations, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +87,7 @@ func vhdPipelines(t *imageType, customizations *blueprint.Customizations, option
|
||||||
}
|
}
|
||||||
|
|
||||||
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[blueprintPkgsKey], customizations.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||||
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
||||||
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
||||||
pipelines = append(pipelines, *treePipeline)
|
pipelines = append(pipelines, *treePipeline)
|
||||||
|
|
@ -107,7 +107,7 @@ func vhdPipelines(t *imageType, customizations *blueprint.Customizations, option
|
||||||
func vmdkPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
func vmdkPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options)
|
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], customizations, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +118,7 @@ func vmdkPipelines(t *imageType, customizations *blueprint.Customizations, optio
|
||||||
}
|
}
|
||||||
|
|
||||||
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[blueprintPkgsKey], customizations.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||||
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
||||||
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
||||||
pipelines = append(pipelines, *treePipeline)
|
pipelines = append(pipelines, *treePipeline)
|
||||||
|
|
@ -138,7 +138,7 @@ func vmdkPipelines(t *imageType, customizations *blueprint.Customizations, optio
|
||||||
func openstackPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
func openstackPipelines(t *imageType, customizations *blueprint.Customizations, options distro.ImageOptions, repos []rpmmd.RepoConfig, packageSetSpecs map[string][]rpmmd.PackageSpec, rng *rand.Rand) ([]osbuild.Pipeline, error) {
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options)
|
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], customizations, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ func openstackPipelines(t *imageType, customizations *blueprint.Customizations,
|
||||||
}
|
}
|
||||||
|
|
||||||
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[blueprintPkgsKey], customizations.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||||
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
||||||
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
||||||
pipelines = append(pipelines, *treePipeline)
|
pipelines = append(pipelines, *treePipeline)
|
||||||
|
|
@ -176,13 +176,12 @@ func openstackPipelines(t *imageType, customizations *blueprint.Customizations,
|
||||||
// Note: the caller of this function has to append the `osbuild.NewSELinuxStage(selinuxStageOptions(false))` stage
|
// Note: the caller of this function has to append the `osbuild.NewSELinuxStage(selinuxStageOptions(false))` stage
|
||||||
// as the last one to the returned pipeline. The stage is not appended on purpose, to allow caller to append
|
// as the last one to the returned pipeline. The stage is not appended on purpose, to allow caller to append
|
||||||
// any additional stages to the pipeline, but before the SELinuxStage, which must be always the last one.
|
// any additional stages to the pipeline, but before the SELinuxStage, which must be always the last one.
|
||||||
func ec2BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, bpPackages []rpmmd.PackageSpec,
|
func ec2BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
c *blueprint.Customizations, options distro.ImageOptions, enabledServices, disabledServices []string,
|
c *blueprint.Customizations, options distro.ImageOptions, enabledServices, disabledServices []string,
|
||||||
defaultTarget string, withRHUI bool, pt *disk.PartitionTable) (*osbuild.Pipeline, error) {
|
defaultTarget string, withRHUI bool, pt *disk.PartitionTable) (*osbuild.Pipeline, error) {
|
||||||
p := new(osbuild.Pipeline)
|
p := new(osbuild.Pipeline)
|
||||||
p.Name = "os"
|
p.Name = "os"
|
||||||
p.Build = "name:build"
|
p.Build = "name:build"
|
||||||
packages = append(packages, bpPackages...)
|
|
||||||
p.AddStage(osbuild.NewRPMStage(osbuild.NewRPMStageOptions(repos), osbuild.NewRpmStageSourceFilesInputs(packages)))
|
p.AddStage(osbuild.NewRPMStage(osbuild.NewRPMStageOptions(repos), osbuild.NewRpmStageSourceFilesInputs(packages)))
|
||||||
|
|
||||||
// If the /boot is on a separate partition, the prefix for the BLS stage must be ""
|
// If the /boot is on a separate partition, the prefix for the BLS stage must be ""
|
||||||
|
|
@ -377,11 +376,11 @@ func ec2BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ec2X86_64BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, bpPackages []rpmmd.PackageSpec,
|
func ec2X86_64BaseTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec,
|
||||||
c *blueprint.Customizations, options distro.ImageOptions, enabledServices, disabledServices []string,
|
c *blueprint.Customizations, options distro.ImageOptions, enabledServices, disabledServices []string,
|
||||||
defaultTarget string, withRHUI bool, pt *disk.PartitionTable) (*osbuild.Pipeline, error) {
|
defaultTarget string, withRHUI bool, pt *disk.PartitionTable) (*osbuild.Pipeline, error) {
|
||||||
|
|
||||||
treePipeline, err := ec2BaseTreePipeline(repos, packages, bpPackages, c, options, enabledServices, disabledServices, defaultTarget, withRHUI, pt)
|
treePipeline, err := ec2BaseTreePipeline(repos, packages, c, options, enabledServices, disabledServices, defaultTarget, withRHUI, pt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -417,10 +416,10 @@ func ec2CommonPipelines(t *imageType, customizations *blueprint.Customizations,
|
||||||
switch arch := t.arch.Name(); arch {
|
switch arch := t.arch.Name(); arch {
|
||||||
// rhel-ec2-x86_64, rhel-ha-ec2
|
// rhel-ec2-x86_64, rhel-ha-ec2
|
||||||
case distro.X86_64ArchName:
|
case distro.X86_64ArchName:
|
||||||
treePipeline, err = ec2X86_64BaseTreePipeline(repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options, t.enabledServices, t.disabledServices, t.defaultTarget, withRHUI, partitionTable)
|
treePipeline, err = ec2X86_64BaseTreePipeline(repos, packageSetSpecs[osPkgsKey], customizations, options, t.enabledServices, t.disabledServices, t.defaultTarget, withRHUI, partitionTable)
|
||||||
// rhel-ec2-aarch64
|
// rhel-ec2-aarch64
|
||||||
case distro.Aarch64ArchName:
|
case distro.Aarch64ArchName:
|
||||||
treePipeline, err = ec2BaseTreePipeline(repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options, t.enabledServices, t.disabledServices, t.defaultTarget, withRHUI, partitionTable)
|
treePipeline, err = ec2BaseTreePipeline(repos, packageSetSpecs[osPkgsKey], customizations, options, t.enabledServices, t.disabledServices, t.defaultTarget, withRHUI, partitionTable)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("ec2CommonPipelines: unsupported image architecture: %q", arch)
|
return nil, fmt.Errorf("ec2CommonPipelines: unsupported image architecture: %q", arch)
|
||||||
}
|
}
|
||||||
|
|
@ -429,7 +428,7 @@ func ec2CommonPipelines(t *imageType, customizations *blueprint.Customizations,
|
||||||
}
|
}
|
||||||
|
|
||||||
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
treePipeline.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(partitionTable)))
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[blueprintPkgsKey], customizations.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||||
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
treePipeline.AddStage(bootloaderConfigStage(t, partitionTable, customizations.GetKernel(), kernelVer, false, false))
|
||||||
// The last stage must be the SELinux stage
|
// The last stage must be the SELinux stage
|
||||||
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
treePipeline.AddStage(osbuild.NewSELinuxStage(selinuxStageOptions(false)))
|
||||||
|
|
@ -468,7 +467,6 @@ func osPipelineRhel86(t *imageType,
|
||||||
imageConfig *distro.ImageConfig,
|
imageConfig *distro.ImageConfig,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
packages []rpmmd.PackageSpec,
|
packages []rpmmd.PackageSpec,
|
||||||
bpPackages []rpmmd.PackageSpec,
|
|
||||||
c *blueprint.Customizations,
|
c *blueprint.Customizations,
|
||||||
options distro.ImageOptions,
|
options distro.ImageOptions,
|
||||||
pt *disk.PartitionTable) (*osbuild.Pipeline, error) {
|
pt *disk.PartitionTable) (*osbuild.Pipeline, error) {
|
||||||
|
|
@ -479,7 +477,6 @@ func osPipelineRhel86(t *imageType,
|
||||||
p.Name = "os"
|
p.Name = "os"
|
||||||
}
|
}
|
||||||
p.Build = "name:build"
|
p.Build = "name:build"
|
||||||
packages = append(packages, bpPackages...)
|
|
||||||
|
|
||||||
if t.rpmOstree && options.OSTree.Parent != "" && options.OSTree.URL != "" {
|
if t.rpmOstree && options.OSTree.Parent != "" && options.OSTree.URL != "" {
|
||||||
p.AddStage(osbuild.NewOSTreePasswdStage("org.osbuild.source", options.OSTree.Parent))
|
p.AddStage(osbuild.NewOSTreePasswdStage("org.osbuild.source", options.OSTree.Parent))
|
||||||
|
|
@ -674,7 +671,7 @@ func osPipelineRhel86(t *imageType,
|
||||||
if pt != nil {
|
if pt != nil {
|
||||||
p = prependKernelCmdlineStage(p, t, pt)
|
p = prependKernelCmdlineStage(p, t, pt)
|
||||||
p.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(pt)))
|
p.AddStage(osbuild.NewFSTabStage(osbuild.NewFSTabStageOptions(pt)))
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(bpPackages, c.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packages, c.GetKernel().Name)
|
||||||
p.AddStage(bootloaderConfigStage(t, pt, c.GetKernel(), kernelVer, false, false))
|
p.AddStage(bootloaderConfigStage(t, pt, c.GetKernel(), kernelVer, false, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -702,14 +699,14 @@ func gcePipelinesRhel86(t *imageType, imageConfig *distro.ImageConfig, customiza
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
treePipeline, err := osPipelineRhel86(t, imageConfig, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options, partitionTable)
|
treePipeline, err := osPipelineRhel86(t, imageConfig, repos, packageSetSpecs[osPkgsKey], customizations, options, partitionTable)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
pipelines = append(pipelines, *treePipeline)
|
pipelines = append(pipelines, *treePipeline)
|
||||||
|
|
||||||
diskfile := "disk.raw"
|
diskfile := "disk.raw"
|
||||||
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[blueprintPkgsKey], customizations.GetKernel().Name)
|
kernelVer := rpmmd.GetVerStrFromPackageSpecListPanic(packageSetSpecs[osPkgsKey], customizations.GetKernel().Name)
|
||||||
imagePipeline := liveImagePipeline(treePipeline.Name, diskfile, partitionTable, t.arch, kernelVer)
|
imagePipeline := liveImagePipeline(treePipeline.Name, diskfile, partitionTable, t.arch, kernelVer)
|
||||||
pipelines = append(pipelines, *imagePipeline)
|
pipelines = append(pipelines, *imagePipeline)
|
||||||
|
|
||||||
|
|
@ -899,7 +896,7 @@ func tarPipelines(t *imageType, customizations *blueprint.Customizations, option
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
|
|
||||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options)
|
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], customizations, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -939,7 +936,7 @@ func imageInstallerPipelines(t *imageType, customizations *blueprint.Customizati
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
|
|
||||||
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options)
|
treePipeline, err := osPipeline(t, repos, packageSetSpecs[osPkgsKey], customizations, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -978,7 +975,7 @@ func edgeCorePipelines(t *imageType, customizations *blueprint.Customizations, o
|
||||||
pipelines := make([]osbuild.Pipeline, 0)
|
pipelines := make([]osbuild.Pipeline, 0)
|
||||||
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
pipelines = append(pipelines, *buildPipeline(repos, packageSetSpecs[buildPkgsKey]))
|
||||||
|
|
||||||
treePipeline, err := ostreeTreePipeline(repos, packageSetSpecs[osPkgsKey], packageSetSpecs[blueprintPkgsKey], customizations, options, t.enabledServices, t.disabledServices, t.defaultTarget)
|
treePipeline, err := ostreeTreePipeline(repos, packageSetSpecs[osPkgsKey], customizations, options, t.enabledServices, t.disabledServices, t.defaultTarget)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -1066,13 +1063,11 @@ func buildPipeline(repos []rpmmd.RepoConfig, buildPackageSpecs []rpmmd.PackageSp
|
||||||
func osPipeline(t *imageType,
|
func osPipeline(t *imageType,
|
||||||
repos []rpmmd.RepoConfig,
|
repos []rpmmd.RepoConfig,
|
||||||
packages []rpmmd.PackageSpec,
|
packages []rpmmd.PackageSpec,
|
||||||
bpPackages []rpmmd.PackageSpec,
|
|
||||||
c *blueprint.Customizations,
|
c *blueprint.Customizations,
|
||||||
options distro.ImageOptions) (*osbuild.Pipeline, error) {
|
options distro.ImageOptions) (*osbuild.Pipeline, error) {
|
||||||
p := new(osbuild.Pipeline)
|
p := new(osbuild.Pipeline)
|
||||||
p.Name = "os"
|
p.Name = "os"
|
||||||
p.Build = "name:build"
|
p.Build = "name:build"
|
||||||
packages = append(packages, bpPackages...)
|
|
||||||
p.AddStage(osbuild.NewRPMStage(osbuild.NewRPMStageOptions(repos), osbuild.NewRpmStageSourceFilesInputs(packages)))
|
p.AddStage(osbuild.NewRPMStage(osbuild.NewRPMStageOptions(repos), osbuild.NewRpmStageSourceFilesInputs(packages)))
|
||||||
p.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{}))
|
p.AddStage(osbuild.NewFixBLSStage(&osbuild.FixBLSStageOptions{}))
|
||||||
language, keyboard := c.GetPrimaryLocale()
|
language, keyboard := c.GetPrimaryLocale()
|
||||||
|
|
@ -1148,13 +1143,11 @@ func osPipeline(t *imageType,
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ostreeTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, bpPackages []rpmmd.PackageSpec, c *blueprint.Customizations, options distro.ImageOptions, enabledServices, disabledServices []string, defaultTarget string) (*osbuild.Pipeline, error) {
|
func ostreeTreePipeline(repos []rpmmd.RepoConfig, packages []rpmmd.PackageSpec, c *blueprint.Customizations, options distro.ImageOptions, enabledServices, disabledServices []string, defaultTarget string) (*osbuild.Pipeline, error) {
|
||||||
p := new(osbuild.Pipeline)
|
p := new(osbuild.Pipeline)
|
||||||
p.Name = "ostree-tree"
|
p.Name = "ostree-tree"
|
||||||
p.Build = "name:build"
|
p.Build = "name:build"
|
||||||
|
|
||||||
packages = append(packages, bpPackages...)
|
|
||||||
|
|
||||||
if options.OSTree.Parent != "" && options.OSTree.URL != "" {
|
if options.OSTree.Parent != "" && options.OSTree.URL != "" {
|
||||||
p.AddStage(osbuild2.NewOSTreePasswdStage("org.osbuild.source", options.OSTree.Parent))
|
p.AddStage(osbuild2.NewOSTreePasswdStage("org.osbuild.source", options.OSTree.Parent))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue