Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fedora: image type names follow variants #1233

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/distro/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}

Expand Down
13 changes: 6 additions & 7 deletions pkg/distro/distro_test_common/distro_test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
}

Expand Down
57 changes: 34 additions & 23 deletions pkg/distro/fedora/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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{},
Expand Down Expand Up @@ -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{},
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand All @@ -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",
Expand Down Expand Up @@ -676,21 +682,25 @@ 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"}
amiImgType.exports = []string{"image"}
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"}
Expand All @@ -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"
Expand Down
Loading
Loading