From 0d358ab2c6a4b63d1c66abac86b0f6b3c31c23e5 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Mon, 17 Feb 2025 11:50:30 +0100 Subject: [PATCH 1/2] fedora: image type names follow variants Fedora consists of many variants. Historically we haven't really based our own definitions on anything. Let's introduce variant name prefixes to all Fedora image types to indicate what variant they are based on. The next commit will then make these variants similar to (or equal to) the Fedora variants as they are supposed to be. We keep the old image type names around as aliases since changing them is a breaking change. We should however consider deprecating them and emitting a warning for some time. Signed-off-by: Simon de Vlieger --- pkg/distro/distro_test.go | 6 +- .../distro_test_common/distro_test_common.go | 13 +- pkg/distro/fedora/distro.go | 57 +++--- pkg/distro/fedora/distro_test.go | 170 +++++++++--------- pkg/distro/fedora/imagetype.go | 6 +- .../packagesets/fedora/package_sets.yaml | 33 ++-- 6 files changed, 150 insertions(+), 135 deletions(-) diff --git a/pkg/distro/distro_test.go b/pkg/distro/distro_test.go index 32c57fc49a..b90fcb59fa 100644 --- a/pkg/distro/distro_test.go +++ b/pkg/distro/distro_test.go @@ -541,12 +541,12 @@ func TestDistro_ManifestFIPSWarning(t *testing.T) { "edge-simplified-installer", "edge-qcow2-image", "iot-installer", - "iot-raw-image", + "iot-raw-xz", "iot-simplified-installer", - "iot-qcow2-image", + "iot-qcow2", } noCustomizableImages := []string{ - "live-installer", + "workstation-live-installer", "azure-eap7-rhui", } diff --git a/pkg/distro/distro_test_common/distro_test_common.go b/pkg/distro/distro_test_common/distro_test_common.go index f1c03e2ac7..7ab0fa7906 100644 --- a/pkg/distro/distro_test_common/distro_test_common.go +++ b/pkg/distro/distro_test_common/distro_test_common.go @@ -22,7 +22,7 @@ func isOSTree(imgType distro.ImageType) bool { } func isUbi(imgType distro.ImageType) bool { - return imgType.Name() == "wsl" + return imgType.Name() == "wsl" || imgType.Name() == "server-wsl" } var knownKernels = []string{"kernel", "kernel-debug", "kernel-rt"} @@ -84,8 +84,8 @@ func TestDistro_KernelOption(t *testing.T, d distro.Distro) { "edge-simplified-installer": true, "edge-vsphere": true, "iot-installer": true, - "iot-qcow2-image": true, - "iot-raw-image": true, + "iot-qcow2": true, + "iot-raw-xz": true, "iot-simplified-installer": true, // the tar image type is a minimal image type which is not expected to @@ -98,8 +98,9 @@ func TestDistro_KernelOption(t *testing.T, d distro.Distro) { // image installer on Fedora doesn't support kernel customizations // on RHEL we support kernel name // TODO: Remove when we unify the allowed options - "image-installer": true, - "live-installer": true, + "image-installer": true, + "minimal-installer": true, + "workstation-live-installer": true, } { // empty blueprint: all image types should just have the default kernel @@ -184,8 +185,6 @@ func TestDistro_OSTreeOptions(t *testing.T, d distro.Distro) { "edge-simplified-installer": true, "iot-ami": true, "iot-installer": true, - "iot-qcow2-image": true, - "iot-raw-image": true, "iot-simplified-installer": true, } diff --git a/pkg/distro/fedora/distro.go b/pkg/distro/fedora/distro.go index 982560e55a..d8290912b6 100644 --- a/pkg/distro/fedora/distro.go +++ b/pkg/distro/fedora/distro.go @@ -62,14 +62,14 @@ var ( // Image Definitions func mkImageInstallerImgType(d distribution) imageType { return imageType{ - name: "image-installer", - nameAliases: []string{"fedora-image-installer"}, + name: "minimal-installer", + nameAliases: []string{"image-installer", "fedora-image-installer"}, filename: "installer.iso", mimeType: "application/x-iso9660-image", packageSets: map[string]packageSetFunc{ osPkgsKey: func(t *imageType) rpmmd.PackageSet { // use the minimal raw image type for the OS package set - return packagesets.Load(t, "minimal-raw", VersionReplacements()) + return packagesets.Load(t, "minimal-raw-xz", VersionReplacements()) }, installerPkgsKey: packageSetLoader, }, @@ -91,8 +91,8 @@ func mkImageInstallerImgType(d distribution) imageType { func mkLiveInstallerImgType(d distribution) imageType { return imageType{ - name: "live-installer", - nameAliases: []string{}, + name: "workstation-live-installer", + nameAliases: []string{"live-installer"}, filename: "live-installer.iso", mimeType: "application/x-iso9660-image", packageSets: map[string]packageSetFunc{ @@ -242,8 +242,8 @@ func mkIotSimplifiedInstallerImgType(d distribution) imageType { func mkIotRawImgType(d distribution) imageType { return imageType{ - name: "iot-raw-image", - nameAliases: []string{"fedora-iot-raw-image"}, + name: "iot-raw-xz", + nameAliases: []string{"iot-raw-image", "fedora-iot-raw-image"}, filename: "image.raw.xz", compression: "xz", mimeType: "application/xz", @@ -276,7 +276,8 @@ func mkIotRawImgType(d distribution) imageType { func mkIotQcow2ImgType(d distribution) imageType { return imageType{ - name: "iot-qcow2-image", + name: "iot-qcow2", + nameAliases: []string{"iot-qcow2-image"}, // kept for backwards compatibility filename: "image.qcow2", mimeType: "application/x-qemu-disk", packageSets: map[string]packageSetFunc{}, @@ -304,7 +305,8 @@ func mkIotQcow2ImgType(d distribution) imageType { func mkQcow2ImgType(d distribution) imageType { return imageType{ - name: "qcow2", + name: "server-qcow2", + nameAliases: []string{"qcow2"}, // kept for backwards compatibility filename: "disk.qcow2", mimeType: "application/x-qemu-disk", environment: &environment.KVM{}, @@ -340,9 +342,10 @@ var ( func mkVmdkImgType(d distribution) imageType { return imageType{ - name: "vmdk", - filename: "disk.vmdk", - mimeType: "application/x-vmdk", + name: "server-vmdk", + nameAliases: []string{"vmdk"}, // kept for backwards compatibility + filename: "disk.vmdk", + mimeType: "application/x-vmdk", packageSets: map[string]packageSetFunc{ osPkgsKey: packageSetLoader, }, @@ -361,9 +364,10 @@ func mkVmdkImgType(d distribution) imageType { func mkOvaImgType(d distribution) imageType { return imageType{ - name: "ova", - filename: "image.ova", - mimeType: "application/ovf", + name: "server-ova", + nameAliases: []string{"ova"}, // kept for backwards compatibility + filename: "image.ova", + mimeType: "application/ovf", packageSets: map[string]packageSetFunc{ osPkgsKey: packageSetLoader, }, @@ -405,9 +409,10 @@ func mkContainerImgType(d distribution) imageType { func mkWslImgType(d distribution) imageType { return imageType{ - name: "wsl", - filename: "wsl.tar", - mimeType: "application/x-tar", + name: "server-wsl", + nameAliases: []string{"wsl"}, // kept for backwards compatibility + filename: "wsl.tar", + mimeType: "application/x-tar", packageSets: map[string]packageSetFunc{ osPkgsKey: packageSetLoader, }, @@ -433,7 +438,8 @@ func mkWslImgType(d distribution) imageType { func mkMinimalRawImgType(d distribution) imageType { return imageType{ - name: "minimal-raw", + name: "minimal-raw-xz", + nameAliases: []string{"minimal-raw"}, // kept for backwards compatibility filename: "disk.raw.xz", compression: "xz", mimeType: "application/xz", @@ -676,10 +682,12 @@ func newDistro(version int) distro.Distro { qcow2ImgType := mkQcow2ImgType(rd) ociImgType := qcow2ImgType - ociImgType.name = "oci" + ociImgType.name = "server-oci" + ociImgType.nameAliases = []string{"oci"} // kept for backwards compatibility amiImgType := qcow2ImgType - amiImgType.name = "ami" + amiImgType.name = "server-ami" + amiImgType.nameAliases = []string{"ami"} // kept for backwards compatibility amiImgType.filename = "image.raw" amiImgType.mimeType = "application/octet-stream" amiImgType.payloadPipelines = []string{"os", "image"} @@ -687,10 +695,12 @@ func newDistro(version int) distro.Distro { amiImgType.environment = &environment.EC2{} openstackImgType := qcow2ImgType - openstackImgType.name = "openstack" + openstackImgType.name = "server-openstack" + openstackImgType.nameAliases = []string{"openstack"} // kept for backwards compatibility vhdImgType := qcow2ImgType - vhdImgType.name = "vhd" + vhdImgType.name = "server-vhd" + vhdImgType.nameAliases = []string{"vhd"} // kept for backwards compatibility vhdImgType.filename = "disk.vhd" vhdImgType.mimeType = "application/x-vhd" vhdImgType.payloadPipelines = []string{"os", "image", "vpc"} @@ -710,6 +720,7 @@ func newDistro(version int) distro.Distro { minimalrawZstdImgType := mkMinimalRawImgType(rd) minimalrawZstdImgType.name = "minimal-raw-zst" + minimalrawZstdImgType.nameAliases = []string{} minimalrawZstdImgType.filename = "disk.raw.zst" minimalrawZstdImgType.mimeType = "application/zstd" minimalrawZstdImgType.compression = "zstd" diff --git a/pkg/distro/fedora/distro_test.go b/pkg/distro/fedora/distro_test.go index 87bd80c847..5faeb2c235 100644 --- a/pkg/distro/fedora/distro_test.go +++ b/pkg/distro/fedora/distro_test.go @@ -46,48 +46,48 @@ func TestFilenameFromType(t *testing.T) { } tests := []testCfg{ { - name: "ami", - args: args{"ami"}, + name: "server-ami", + args: args{"server-ami"}, want: wantResult{ filename: "image.raw", mimeType: "application/octet-stream", }, }, { - name: "qcow2", - args: args{"qcow2"}, + name: "server-qcow2", + args: args{"server-qcow2"}, want: wantResult{ filename: "disk.qcow2", mimeType: "application/x-qemu-disk", }, }, { - name: "openstack", - args: args{"openstack"}, + name: "server-openstack", + args: args{"server-openstack"}, want: wantResult{ filename: "disk.qcow2", mimeType: "application/x-qemu-disk", }, }, { - name: "vhd", - args: args{"vhd"}, + name: "server-vhd", + args: args{"server-vhd"}, want: wantResult{ filename: "disk.vhd", mimeType: "application/x-vhd", }, }, { - name: "vmdk", - args: args{"vmdk"}, + name: "server-vmdk", + args: args{"server-vmdk"}, want: wantResult{ filename: "disk.vmdk", mimeType: "application/x-vmdk", }, }, { - name: "ova", - args: args{"ova"}, + name: "server-ova", + args: args{"server-ova"}, want: wantResult{ filename: "image.ova", mimeType: "application/ovf", @@ -102,8 +102,8 @@ func TestFilenameFromType(t *testing.T) { }, }, { - name: "wsl", - args: args{"wsl"}, + name: "server-wsl", + args: args{"server-wsl"}, want: wantResult{ filename: "wsl.tar", mimeType: "application/x-tar", @@ -187,8 +187,8 @@ func TestFilenameFromType(t *testing.T) { want: wantResult{wantErr: true}, }, { - name: "minimal-raw", - args: args{"minimal-raw"}, + name: "minimal-raw-xz", + args: args{"minimal-raw-xz"}, want: wantResult{ filename: "disk.raw.xz", mimeType: "application/xz", @@ -323,23 +323,23 @@ func TestImageType_Name(t *testing.T) { { arch: "x86_64", imgNames: []string{ - "ami", - "image-installer", + "server-ami", + "minimal-installer", "iot-commit", "iot-container", "iot-installer", - "iot-qcow2-image", - "iot-raw-image", - "live-installer", - "minimal-raw", + "iot-qcow2", + "iot-raw-xz", + "workstation-live-installer", + "minimal-raw-xz", "minimal-raw-zst", - "oci", - "openstack", - "ova", - "qcow2", - "vhd", - "vmdk", - "wsl", + "server-oci", + "server-openstack", + "server-ova", + "server-qcow2", + "server-vhd", + "server-vmdk", + "server-wsl", }, verTypes: map[string][]string{ "40": { @@ -355,18 +355,18 @@ func TestImageType_Name(t *testing.T) { { arch: "aarch64", imgNames: []string{ - "ami", - "image-installer", + "server-ami", + "minimal-installer", "iot-commit", "iot-container", "iot-installer", - "iot-qcow2-image", - "iot-raw-image", - "minimal-raw", + "iot-qcow2", + "iot-raw-xz", + "minimal-raw-xz", "minimal-raw-zst", - "oci", - "openstack", - "qcow2", + "server-oci", + "server-openstack", + "server-qcow2", }, verTypes: map[string][]string{ "40": { @@ -502,11 +502,11 @@ func TestDistro_ManifestError(t *testing.T) { assert.EqualError(t, err, "kernel boot parameter customizations are not supported for ostree types") } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" { assert.EqualError(t, err, fmt.Sprintf("boot ISO image type \"%s\" requires specifying a URL from which to retrieve the OSTree commit", imgTypeName)) - } else if imgTypeName == "image-installer" { + } else if imgTypeName == "minimal-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.UnsupportedCustomizationError, imgTypeName, "User, Group, FIPS, Installer, Timezone, Locale")) - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) - } else if imgTypeName == "iot-raw-image" || imgTypeName == "iot-qcow2-image" { + } else if imgTypeName == "iot-raw-xz" || imgTypeName == "iot-qcow2" { assert.EqualError(t, err, fmt.Sprintf(distro.UnsupportedCustomizationError, imgTypeName, "User, Group, Directories, Files, Services, FIPS")) } else { assert.NoError(t, err) @@ -526,24 +526,24 @@ func TestArchitecture_ListImageTypes(t *testing.T) { { arch: "x86_64", imgNames: []string{ - "ami", + "server-ami", "container", - "image-installer", + "minimal-installer", "iot-commit", "iot-container", "iot-installer", - "iot-qcow2-image", - "iot-raw-image", - "live-installer", - "minimal-raw", + "iot-qcow2", + "iot-raw-xz", + "workstation-live-installer", + "minimal-raw-xz", "minimal-raw-zst", - "oci", - "openstack", - "ova", - "qcow2", - "vhd", - "vmdk", - "wsl", + "server-oci", + "server-openstack", + "server-ova", + "server-qcow2", + "server-vhd", + "server-vmdk", + "server-wsl", }, verTypes: map[string][]string{ "40": { @@ -559,20 +559,20 @@ func TestArchitecture_ListImageTypes(t *testing.T) { { arch: "aarch64", imgNames: []string{ - "ami", + "server-ami", "container", - "image-installer", + "minimal-installer", "iot-commit", "iot-container", "iot-installer", - "iot-qcow2-image", - "iot-raw-image", - "live-installer", - "minimal-raw", + "iot-qcow2", + "iot-raw-xz", + "workstation-live-installer", + "minimal-raw-xz", "minimal-raw-zst", - "oci", - "openstack", - "qcow2", + "server-oci", + "server-openstack", + "server-qcow2", }, verTypes: map[string][]string{ "40": { @@ -589,7 +589,7 @@ func TestArchitecture_ListImageTypes(t *testing.T) { arch: "ppc64le", imgNames: []string{ "container", - "qcow2", + "server-qcow2", }, verTypes: map[string][]string{ "40": { @@ -604,7 +604,7 @@ func TestArchitecture_ListImageTypes(t *testing.T) { arch: "s390x", imgNames: []string{ "container", - "qcow2", + "server-qcow2", }, verTypes: map[string][]string{ "40": { @@ -619,7 +619,7 @@ func TestArchitecture_ListImageTypes(t *testing.T) { arch: "riscv64", imgNames: []string{ "container", - "minimal-raw", + "minimal-raw-xz", "minimal-raw-zst", }, }, @@ -739,11 +739,11 @@ func TestDistro_CustomFileSystemManifestError(t *testing.T) { _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) if imgTypeName == "iot-commit" || imgTypeName == "iot-container" || imgTypeName == "iot-bootable-container" { assert.EqualError(t, err, "Custom mountpoints and partitioning are not supported for ostree types") - } else if imgTypeName == "iot-raw-image" || imgTypeName == "iot-qcow2-image" { + } else if imgTypeName == "iot-raw-xz" || imgTypeName == "iot-qcow2" { assert.EqualError(t, err, fmt.Sprintf(distro.UnsupportedCustomizationError, imgTypeName, "User, Group, Directories, Files, Services, FIPS")) - } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "image-installer" { + } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.EqualError(t, err, "The following errors occurred while setting up custom mountpoints:\npath \"/etc\" is not allowed") @@ -773,11 +773,11 @@ func TestDistro_TestRootMountPoint(t *testing.T) { _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) if imgTypeName == "iot-commit" || imgTypeName == "iot-container" || imgTypeName == "iot-bootable-container" { assert.EqualError(t, err, "Custom mountpoints and partitioning are not supported for ostree types") - } else if imgTypeName == "iot-raw-image" || imgTypeName == "iot-qcow2-image" { + } else if imgTypeName == "iot-raw-xz" || imgTypeName == "iot-qcow2" { assert.EqualError(t, err, fmt.Sprintf(distro.UnsupportedCustomizationError, imgTypeName, "User, Group, Directories, Files, Services, FIPS")) - } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "image-installer" { + } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.NoError(t, err) @@ -809,9 +809,9 @@ func TestDistro_CustomFileSystemSubDirectories(t *testing.T) { for _, imgTypeName := range arch.ListImageTypes() { imgType, _ := arch.GetImageType(imgTypeName) _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) - if strings.HasPrefix(imgTypeName, "iot-") || strings.HasPrefix(imgTypeName, "image-") { + if strings.HasPrefix(imgTypeName, "iot-") || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.NoError(t, err) @@ -851,9 +851,9 @@ func TestDistro_MountpointsWithArbitraryDepthAllowed(t *testing.T) { for _, imgTypeName := range arch.ListImageTypes() { imgType, _ := arch.GetImageType(imgTypeName) _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) - if strings.HasPrefix(imgTypeName, "iot-") || strings.HasPrefix(imgTypeName, "image-") { + if strings.HasPrefix(imgTypeName, "iot-") || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.NoError(t, err) @@ -889,9 +889,9 @@ func TestDistro_DirtyMountpointsNotAllowed(t *testing.T) { for _, imgTypeName := range arch.ListImageTypes() { imgType, _ := arch.GetImageType(imgTypeName) _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) - if strings.HasPrefix(imgTypeName, "iot-") || strings.HasPrefix(imgTypeName, "image-") { + if strings.HasPrefix(imgTypeName, "iot-") || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.EqualError(t, err, "The following errors occurred while setting up custom mountpoints:\npath \"//\" must be canonical\npath \"/var//\" must be canonical\npath \"/var//log/audit/\" must be canonical") @@ -921,11 +921,11 @@ func TestDistro_CustomUsrPartitionNotLargeEnough(t *testing.T) { _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) if imgTypeName == "iot-commit" || imgTypeName == "iot-container" || imgTypeName == "iot-bootable-container" { assert.EqualError(t, err, "Custom mountpoints and partitioning are not supported for ostree types") - } else if imgTypeName == "iot-raw-image" || imgTypeName == "iot-qcow2-image" { + } else if imgTypeName == "iot-raw-xz" || imgTypeName == "iot-qcow2" { assert.EqualError(t, err, fmt.Sprintf(distro.UnsupportedCustomizationError, imgTypeName, "User, Group, Directories, Files, Services, FIPS")) - } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "image-installer" { + } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.NoError(t, err) @@ -966,11 +966,11 @@ func TestDistro_PartitioningConflict(t *testing.T) { _, _, err := imgType.Manifest(&bp, distro.ImageOptions{}, nil, nil) if imgTypeName == "iot-commit" || imgTypeName == "iot-container" || imgTypeName == "iot-bootable-container" { assert.EqualError(t, err, "Custom mountpoints and partitioning are not supported for ostree types") - } else if imgTypeName == "iot-raw-image" || imgTypeName == "iot-qcow2-image" { + } else if imgTypeName == "iot-raw-xz" || imgTypeName == "iot-qcow2" { assert.EqualError(t, err, fmt.Sprintf(distro.UnsupportedCustomizationError, imgTypeName, "User, Group, Directories, Files, Services, FIPS")) - } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "image-installer" { + } else if imgTypeName == "iot-installer" || imgTypeName == "iot-simplified-installer" || imgTypeName == "minimal-installer" { continue - } else if imgTypeName == "live-installer" { + } else if imgTypeName == "workstation-live-installer" { assert.EqualError(t, err, fmt.Sprintf(distro.NoCustomizationsAllowedError, imgTypeName)) } else { assert.EqualError(t, err, "partitioning customizations cannot be used with custom filesystems (mountpoints)") @@ -1054,11 +1054,13 @@ func TestDistro_DiskCustomizationRunsValidateLayoutConstraints(t *testing.T) { for _, archName := range fedoraDistro.ListArches() { arch, err := fedoraDistro.GetArch(archName) assert.NoError(t, err) + // XXX: enable once we support qcow2 on riscv64 if arch.Name() == "riscv64" { continue } - imgType, err := arch.GetImageType("qcow2") + + imgType, err := arch.GetImageType("server-qcow2") assert.NoError(t, err, archName) t.Run(fmt.Sprintf("%s/%s", archName, imgType.Name()), func(t *testing.T) { imgType, _ := arch.GetImageType(imgType.Name()) diff --git a/pkg/distro/fedora/imagetype.go b/pkg/distro/fedora/imagetype.go index bd825c3015..f6f01edfba 100644 --- a/pkg/distro/fedora/imagetype.go +++ b/pkg/distro/fedora/imagetype.go @@ -336,7 +336,7 @@ func (t *imageType) checkOptions(bp *blueprint.Blueprint, options distro.ImageOp } } - if t.name == "iot-raw-image" || t.name == "iot-qcow2-image" { + if t.name == "iot-raw-xz" || t.name == "iot-qcow2" { allowed := []string{"User", "Group", "Directories", "Files", "Services", "FIPS"} if err := customizations.CheckAllowed(allowed...); err != nil { return warnings, fmt.Errorf(distro.UnsupportedCustomizationError, t.name, strings.Join(allowed, ", ")) @@ -385,13 +385,13 @@ func (t *imageType) checkOptions(bp *blueprint.Blueprint, options distro.ImageOp return warnings, fmt.Errorf("ignition.firstboot requires a provisioning url") } } - } else if t.name == "iot-installer" || t.name == "image-installer" { + } else if t.name == "iot-installer" || t.name == "minimal-installer" { // "Installer" is actually not allowed for image-installer right now, but this is checked at the end allowed := []string{"User", "Group", "FIPS", "Installer", "Timezone", "Locale"} if err := customizations.CheckAllowed(allowed...); err != nil { return warnings, fmt.Errorf(distro.UnsupportedCustomizationError, t.name, strings.Join(allowed, ", ")) } - } else if t.name == "live-installer" { + } else if t.name == "workstation-live-installer" { allowed := []string{"Installer"} if err := customizations.CheckAllowed(allowed...); err != nil { return warnings, fmt.Errorf(distro.NoCustomizationsAllowedError, t.name) diff --git a/pkg/distro/packagesets/fedora/package_sets.yaml b/pkg/distro/packagesets/fedora/package_sets.yaml index 6d81dd6268..59d3a7e966 100644 --- a/pkg/distro/packagesets/fedora/package_sets.yaml +++ b/pkg/distro/packagesets/fedora/package_sets.yaml @@ -11,7 +11,7 @@ cloud_base: # not used directly; added for reference - "geolite2-country" - "plymouth" -qcow2: &qcow2 +server_qcow2: &server_qcow2 include: # cloud_base - "@Fedora Cloud Server" @@ -28,16 +28,16 @@ qcow2: &qcow2 - "geolite2-country" - "plymouth" -ami: - <<: *qcow2 +server_ami: + <<: *server_qcow2 -oci: - <<: *qcow2 +server_oci: + <<: *server_qcow2 -openstack: - <<: *qcow2 +server_openstack: + <<: *server_qcow2 -vhd: +server_vhd: include: # cloud_base - "@Fedora Cloud Server" @@ -54,7 +54,7 @@ vhd: - "geolite2-country" - "plymouth" -vmdk: &vmdk +server_vmdk: &server_vmdk include: - "@Fedora Cloud Server" - "chrony" @@ -73,8 +73,8 @@ vmdk: &vmdk - "grubby-deprecated" - "extlinux-bootloader" -ova: - <<: *vmdk +server_ova: + <<: *server_vmdk # NOTE: keep in sync with official fedora-iot definitions: # https://pagure.io/fedora-iot/ostree/blob/main/f/fedora-iot-base.yaml @@ -602,7 +602,7 @@ iot_installer: - "dmidecode" -live_installer: +workstation_live_installer: include: - "@workstation-product-environment" - "@anaconda-tools" @@ -634,7 +634,7 @@ live_installer: - "anaconda-webui" -image_installer: +minimal_installer: # anaconda include: - "aajohan-comfortaa-fonts" @@ -818,10 +818,10 @@ container: &container - "whois-nls" - "xkeyboard-config" -wsl: +server_wsl: <<: *container -minimal_raw: &minimal +minimal: &minimal include: - "@core" - "initial-setup" @@ -848,6 +848,9 @@ minimal_raw: &minimal minimal_raw_zst: <<: *minimal +minimal_raw_xz: + <<: *minimal + iot_simplified_installer: include: # installer.include From bd9a845db7070a9f16a05035b2e4e44dd3f29e4e Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Mon, 24 Feb 2025 12:03:36 +0100 Subject: [PATCH 2/2] test: update config maps to new names Adds in the new names where applicable, or replaces them where configs only concern fedora. Signed-off-by: Simon de Vlieger --- test/config-map.json | 61 +++++++++++++++++++++++++--------- test/configs/empty-fedora.json | 4 +++ test/configs/empty-rhel.json | 4 +++ 3 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 test/configs/empty-fedora.json create mode 100644 test/configs/empty-rhel.json diff --git a/test/config-map.json b/test/config-map.json index 53ce9c84e2..2ecc226697 100644 --- a/test/config-map.json +++ b/test/config-map.json @@ -8,7 +8,8 @@ "fedora*" ], "image-types": [ - "ami" + "ami", + "server-ami" ] }, "./configs/all-with-fips.json": { @@ -21,7 +22,8 @@ "fedora*" ], "image-types": [ - "qcow2" + "qcow2", + "server-qcow2" ] }, "./configs/disable-lm_sensors.json": { @@ -120,9 +122,12 @@ "edge-commit" ] }, - "./configs/empty.json": { + "./configs/empty-rhel.json": { "arches": [], - "distros": [], + "distros": [ + "rhel-*", + "centos-*" + ], "image-types": [ "ami", "azure-eap7-rhui", @@ -135,8 +140,6 @@ "gce", "gce-rhui", "image-installer", - "iot-bootable-container", - "iot-container", "live-installer", "minimal-raw", "minimal-raw-zst", @@ -150,6 +153,29 @@ "wsl" ] }, + "./configs/empty-fedora.json": { + "arches": [], + "distros": [ + "fedora-*" + ], + "image-types": [ + "container", + "server-ami", + "minimal-installer", + "workstation-live-installer", + "minimal-raw-xz", + "minimal-raw-zst", + "server-oci", + "server-openstack", + "server-ova", + "server-qcow2", + "server-vhd", + "server-vmdk", + "server-wsl", + "iot-bootable-container", + "iot-container" + ] + }, "./configs/iot-customizations-full.json": { "image-types": [ "iot-container" @@ -163,13 +189,13 @@ "./configs/iot-ostree-pull-empty.json": { "image-types": [ "iot-installer", - "iot-qcow2-image", - "iot-raw-image" + "iot-qcow2", + "iot-raw-xz" ] }, "./configs/iot-ostree-pull-user.json": { "image-types": [ - "iot-qcow2-image" + "iot-qcow2" ] }, "./configs/kernel-debug.json": { @@ -182,7 +208,7 @@ "fedora*" ], "image-types": [ - "qcow2" + "server-qcow2" ] }, "./configs/minimal.json": { @@ -190,7 +216,7 @@ "fedora*" ], "image-types": [ - "qcow2" + "server-qcow2" ] }, "./configs/oscap-generic.json": { @@ -205,7 +231,8 @@ "fedora*" ], "image-types": [ - "qcow2" + "qcow2", + "server-qcow2" ] }, "./configs/oscap-rhel8.json": { @@ -318,7 +345,7 @@ }, "./configs/import-rpm-gpg-keys-from-tree-fedora.json": { "image-types": [ - "qcow2" + "server-qcow2" ], "distros": [ "fedora*" @@ -336,7 +363,8 @@ }, "./configs/partitioning-plain.json": { "image-types": [ - "ami" + "ami", + "server-ami" ], "distros": [ "centos-10", @@ -348,7 +376,7 @@ }, "./configs/partitioning-btrfs.json": { "image-types": [ - "ami" + "server-ami" ], "distros": [ "fedora*" @@ -356,7 +384,8 @@ }, "./configs/partitioning-lvm.json": { "image-types": [ - "ami" + "ami", + "server-ami" ], "distros": [ "centos-10", diff --git a/test/configs/empty-fedora.json b/test/configs/empty-fedora.json new file mode 100644 index 0000000000..4a5641ed11 --- /dev/null +++ b/test/configs/empty-fedora.json @@ -0,0 +1,4 @@ +{ + "name": "empty-fedora", + "blueprint": {} +} diff --git a/test/configs/empty-rhel.json b/test/configs/empty-rhel.json new file mode 100644 index 0000000000..afd4dae845 --- /dev/null +++ b/test/configs/empty-rhel.json @@ -0,0 +1,4 @@ +{ + "name": "empty-rhel", + "blueprint": {} +}