distro: remove packageSetChains from image type in RHEL 8 & 9
Image types no longer report their chains. Instead, pipelines report their packages and chains and blueprint packages are added to the workload. The distro.ImageType interface retains the PackageSetsChains() methods for RHEL 7 until that is rewritten as well. The osbuild-dnf-json-test doesn't use the PackageSetsChains() method anymore. Instead, since it only test the centos-8 qcow2 image, it hardcodes the expected package set names.
This commit is contained in:
parent
5db70ed3f5
commit
e4bb7f4f16
14 changed files with 3 additions and 115 deletions
|
|
@ -101,29 +101,8 @@ func TestDepsolvePackageSets(t *testing.T) {
|
|||
require.Nilf(t, err, "failed to get %q image type of %q/%q distro/arch", qcow2ImageTypeName, distroStruct.Name(), distro.X86_64ArchName)
|
||||
|
||||
imagePkgSets := qcow2Image.PackageSets(blueprint.Blueprint{Packages: []blueprint.Package{{Name: "bind"}}}, distro.ImageOptions{}, x86Repos)
|
||||
imagePkgSetChains := qcow2Image.PackageSetsChains()
|
||||
require.NotEmptyf(t, imagePkgSetChains, "the %q image has no package set chains defined", qcow2ImageTypeName)
|
||||
|
||||
expectedPackageSpecsSetNames := func(pkgSets map[string][]rpmmd.PackageSet, pkgSetChains map[string][]string) []string {
|
||||
expectedPkgSpecsSetNames := make([]string, 0, len(pkgSets))
|
||||
chainPkgSets := make(map[string]struct{}, len(pkgSets))
|
||||
for name, pkgSetChain := range pkgSetChains {
|
||||
expectedPkgSpecsSetNames = append(expectedPkgSpecsSetNames, name)
|
||||
for _, pkgSetName := range pkgSetChain {
|
||||
chainPkgSets[pkgSetName] = struct{}{}
|
||||
}
|
||||
}
|
||||
for name := range pkgSets {
|
||||
if _, ok := chainPkgSets[name]; ok {
|
||||
continue
|
||||
}
|
||||
expectedPkgSpecsSetNames = append(expectedPkgSpecsSetNames, name)
|
||||
}
|
||||
return expectedPkgSpecsSetNames
|
||||
}(imagePkgSets, imagePkgSetChains)
|
||||
|
||||
gotPackageSpecsSets := make(map[string][]rpmmd.PackageSpec, len(imagePkgSets))
|
||||
|
||||
for name, pkgSet := range imagePkgSets {
|
||||
res, err := solver.Depsolve(pkgSet)
|
||||
if err != nil {
|
||||
|
|
@ -131,6 +110,7 @@ func TestDepsolvePackageSets(t *testing.T) {
|
|||
}
|
||||
gotPackageSpecsSets[name] = res
|
||||
}
|
||||
expectedPackageSpecsSetNames := []string{"build", "os"}
|
||||
require.EqualValues(t, len(expectedPackageSpecsSetNames), len(gotPackageSpecsSets))
|
||||
for _, name := range expectedPackageSpecsSetNames {
|
||||
_, ok := gotPackageSpecsSets[name]
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ func amiImgTypeX86_64(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: ec2CommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAMIImageConfigX86_64(rd),
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
|
||||
bootable: true,
|
||||
|
|
@ -42,9 +39,6 @@ func ec2ImgTypeX86_64(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: rhelEc2PackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultEc2ImageConfigX86_64(rd),
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
|
||||
bootable: true,
|
||||
|
|
@ -68,9 +62,6 @@ func ec2HaImgTypeX86_64(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: rhelEc2HaPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultEc2ImageConfigX86_64(rd),
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto",
|
||||
bootable: true,
|
||||
|
|
@ -93,9 +84,6 @@ func amiImgTypeAarch64(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: ec2CommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAMIImageConfig(rd),
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto",
|
||||
bootable: true,
|
||||
|
|
@ -118,9 +106,6 @@ func ec2ImgTypeAarch64(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: rhelEc2PackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultEc2ImageConfig(rd),
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0 crashkernel=auto",
|
||||
bootable: true,
|
||||
|
|
@ -143,9 +128,6 @@ func ec2SapImgTypeX86_64(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: rhelEc2SapPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultEc2SapImageConfigX86_64(rd),
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 crashkernel=auto processor.max_cstate=1 intel_idle.max_cstate=1",
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -19,9 +19,6 @@ func azureRhuiImgType() imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: azureRhuiPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAzureRhuiImageConfig.InheritFrom(defaultAzureImageConfig),
|
||||
kernelOptions: defaultAzureKernelOptions,
|
||||
bootable: true,
|
||||
|
|
@ -43,9 +40,6 @@ func azureSapImgType(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: azureSapPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: SapAzureImageConfig(rd),
|
||||
kernelOptions: defaultAzureKernelOptions,
|
||||
bootable: true,
|
||||
|
|
@ -67,9 +61,6 @@ func azureByosImgType() imageType {
|
|||
// the ec2 buildroot is required due to the cloud-init stage and dependency on YAML
|
||||
osPkgsKey: azurePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAzureByosImageConfig.InheritFrom(defaultAzureImageConfig),
|
||||
kernelOptions: defaultAzureKernelOptions,
|
||||
bootable: true,
|
||||
|
|
@ -92,9 +83,6 @@ func azureImgType() imageType {
|
|||
// the ec2 buildroot is required due to the cloud-init stage and dependency on YAML
|
||||
osPkgsKey: azurePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAzureImageConfig,
|
||||
kernelOptions: defaultAzureKernelOptions,
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -39,9 +39,6 @@ func tarImgType() imageType {
|
|||
}
|
||||
},
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
image: tarImage,
|
||||
buildPipelines: []string{"build"},
|
||||
payloadPipelines: []string{"os", "archive"},
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ func edgeCommitImgType(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: edgeCommitPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
EnabledServices: edgeServices(rd),
|
||||
},
|
||||
|
|
@ -46,9 +43,6 @@ func edgeOCIImgType(rd distribution) imageType {
|
|||
}
|
||||
},
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
EnabledServices: edgeServices(rd),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@ func gceImgType(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: gcePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultGceByosImageConfig(rd),
|
||||
kernelOptions: gceKernelOptions,
|
||||
bootable: true,
|
||||
|
|
@ -42,9 +39,6 @@ func gceRhuiImgType(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: gceRhuiPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultGceRhuiImageConfig(rd),
|
||||
kernelOptions: gceKernelOptions,
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ type imageType struct {
|
|||
compression string // TODO: remove from image definition and make it a transport option
|
||||
mimeType string
|
||||
packageSets map[string]packageSetFunc
|
||||
packageSetChains map[string][]string
|
||||
defaultImageConfig *distro.ImageConfig
|
||||
kernelOptions string
|
||||
defaultSize uint64
|
||||
|
|
@ -119,7 +118,7 @@ func (t *imageType) PayloadPackageSets() []string {
|
|||
}
|
||||
|
||||
func (t *imageType) PackageSetsChains() map[string][]string {
|
||||
return t.packageSetChains
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *imageType) Exports() []string {
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@ func qcow2ImgType(rd distribution) imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: qcow2CommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: &distro.ImageConfig{
|
||||
DefaultTarget: common.ToPtr("multi-user.target"),
|
||||
},
|
||||
|
|
@ -57,9 +54,6 @@ func openstackImgType() imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: openstackCommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: "ro net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 4 * common.GibiByte,
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@ func vmdkImgType() imageType {
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: vmdkCommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: "ro net.ifnames=0",
|
||||
bootable: true,
|
||||
defaultSize: 4 * common.GibiByte,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ var (
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: ec2CommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: amiKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.LegacyBootType,
|
||||
|
|
@ -39,9 +36,6 @@ var (
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: rhelEc2PackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: amiKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.LegacyBootType,
|
||||
|
|
@ -62,9 +56,6 @@ var (
|
|||
buildPkgsKey: ec2BuildPackageSet,
|
||||
osPkgsKey: rhelEc2HaPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: amiKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.LegacyBootType,
|
||||
|
|
@ -84,9 +75,6 @@ var (
|
|||
buildPkgsKey: ec2BuildPackageSet,
|
||||
osPkgsKey: ec2CommonPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0",
|
||||
bootable: true,
|
||||
defaultSize: 10 * common.GibiByte,
|
||||
|
|
@ -106,9 +94,6 @@ var (
|
|||
buildPkgsKey: ec2BuildPackageSet,
|
||||
osPkgsKey: rhelEc2PackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 iommu.strict=0",
|
||||
bootable: true,
|
||||
defaultSize: 10 * common.GibiByte,
|
||||
|
|
@ -128,9 +113,6 @@ var (
|
|||
buildPkgsKey: ec2BuildPackageSet,
|
||||
osPkgsKey: rhelEc2SapPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: "console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 processor.max_cstate=1 intel_idle.max_cstate=1",
|
||||
bootable: true,
|
||||
bootType: distro.LegacyBootType,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ var (
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: azurePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAzureImageConfig,
|
||||
kernelOptions: defaultAzureKernelOptions,
|
||||
bootable: true,
|
||||
|
|
@ -39,9 +36,6 @@ var (
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: azurePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
defaultImageConfig: defaultAzureByosImageConfig.InheritFrom(defaultAzureImageConfig),
|
||||
kernelOptions: defaultAzureKernelOptions,
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ var (
|
|||
}
|
||||
},
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
image: tarImage,
|
||||
buildPipelines: []string{"build"},
|
||||
payloadPipelines: []string{"os", "root-tar"},
|
||||
|
|
@ -37,9 +34,6 @@ var (
|
|||
osPkgsKey: bareMetalPackageSet,
|
||||
installerPkgsKey: anacondaPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
rpmOstree: false,
|
||||
bootISO: true,
|
||||
bootable: true,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ var (
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: gcePackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: gceKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.UEFIBootType,
|
||||
|
|
@ -38,9 +35,6 @@ var (
|
|||
packageSets: map[string]packageSetFunc{
|
||||
osPkgsKey: gceRhuiPackageSet,
|
||||
},
|
||||
packageSetChains: map[string][]string{
|
||||
osPkgsKey: {osPkgsKey, blueprintPkgsKey},
|
||||
},
|
||||
kernelOptions: gceKernelOptions,
|
||||
bootable: true,
|
||||
bootType: distro.UEFIBootType,
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ type imageType struct {
|
|||
compression string // TODO: remove from image definition and make it a transport option
|
||||
mimeType string
|
||||
packageSets map[string]packageSetFunc
|
||||
packageSetChains map[string][]string
|
||||
defaultImageConfig *distro.ImageConfig
|
||||
kernelOptions string
|
||||
defaultSize uint64
|
||||
|
|
@ -122,7 +121,7 @@ func (t *imageType) PayloadPackageSets() []string {
|
|||
}
|
||||
|
||||
func (t *imageType) PackageSetsChains() map[string][]string {
|
||||
return t.packageSetChains
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *imageType) Exports() []string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue