Skip to content

Commit 65194a4

Browse files
supakeenachilleas-k
authored andcommitted
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 <supakeen@redhat.com>
1 parent e57c329 commit 65194a4

File tree

10 files changed

+1055
-1012
lines changed

10 files changed

+1055
-1012
lines changed

pkg/distro/defs/fedora/distro.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -272,26 +272,27 @@ image_config:
272272
timezone: "UTC"
273273

274274
image_types:
275-
qcow2: &qcow2
275+
server_qcow2: &server_qcow2
276276
partition_table:
277277
<<: *default_partition_tables
278278
package_sets:
279-
- *cloud_base_pkgset
280-
- include:
281-
- "qemu-guest-agent"
282-
ami: *qcow2
283-
oci: *qcow2
284-
openstack: *qcow2
279+
- *cloud_base_pkgset
280+
- include:
281+
- "qemu-guest-agent"
282+
283+
server_ami: *server_qcow2
284+
server_oci: *server_qcow2
285+
server_openstack: *server_qcow2
285286

286-
vhd:
287+
server_vhd:
287288
partition_table:
288289
<<: *default_partition_tables
289290
package_sets:
290291
- *cloud_base_pkgset
291292
- include:
292293
- "WALinuxAgent"
293294

294-
vmdk: &vmdk
295+
server_vmdk: &server_vmdk
295296
partition_table:
296297
<<: *default_partition_tables
297298
package_sets:
@@ -313,7 +314,7 @@ image_types:
313314
- "grubby-deprecated"
314315
- "extlinux-bootloader"
315316

316-
ova: *vmdk
317+
server_ova: *server_vmdk
317318

318319
# NOTE: keep in sync with official fedora-iot definitions:
319320
# https://pagure.io/fedora-iot/ostree/blob/main/f/fedora-iot-base.yaml
@@ -437,7 +438,7 @@ image_types:
437438

438439
iot_container: *iot_commit
439440

440-
iot_raw_image:
441+
iot_raw_xz:
441442
partition_table:
442443
<<: *iot_base_partition_tables
443444
partition_table_override:
@@ -447,7 +448,7 @@ image_types:
447448
- partition_index: 2
448449
fstab_options: "defaults,ro"
449450

450-
iot_qcow2_image:
451+
iot_qcow2:
451452
partition_table:
452453
<<: *iot_base_partition_tables
453454

@@ -722,7 +723,7 @@ image_types:
722723
- include:
723724
- "fedora-release-iot"
724725

725-
live_installer:
726+
workstation_live_installer:
726727
package_sets:
727728
- include:
728729
- "@workstation-product-environment"
@@ -754,7 +755,7 @@ image_types:
754755
include:
755756
- "anaconda-webui"
756757

757-
image_installer: *anaconda
758+
minimal_installer: *anaconda
758759

759760
container: &container
760761
package_sets:
@@ -803,7 +804,7 @@ image_types:
803804
- "whois-nls"
804805
- "xkeyboard-config"
805806

806-
wsl:
807+
server_wsl:
807808
package_sets:
808809
- include:
809810
- "bash"
@@ -878,6 +879,7 @@ image_types:
878879
exclude:
879880
- "firewalld"
880881
minimal_raw_zst: *minimal_raw
882+
minimal_raw_xz: *minimal_raw
881883

882884
iot_simplified_installer:
883885
partition_table:

pkg/distro/distro_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,12 @@ func TestDistro_ManifestFIPSWarning(t *testing.T) {
543543
"edge-simplified-installer",
544544
"edge-qcow2-image",
545545
"iot-installer",
546-
"iot-raw-image",
546+
"iot-raw-xz",
547547
"iot-simplified-installer",
548-
"iot-qcow2-image",
548+
"iot-qcow2",
549549
}
550550
noCustomizableImages := []string{
551-
"live-installer",
551+
"workstation-live-installer",
552552
"azure-eap7-rhui",
553553
}
554554

pkg/distro/distro_test_common/distro_test_common.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func isOSTree(imgType distro.ImageType) bool {
2222
}
2323

2424
func isUbi(imgType distro.ImageType) bool {
25-
return imgType.Name() == "wsl"
25+
return imgType.Name() == "wsl" || imgType.Name() == "server-wsl"
2626
}
2727

2828
var knownKernels = []string{"kernel", "kernel-debug", "kernel-rt"}
@@ -84,8 +84,8 @@ func TestDistro_KernelOption(t *testing.T, d distro.Distro) {
8484
"edge-simplified-installer": true,
8585
"edge-vsphere": true,
8686
"iot-installer": true,
87-
"iot-qcow2-image": true,
88-
"iot-raw-image": true,
87+
"iot-qcow2": true,
88+
"iot-raw-xz": true,
8989
"iot-simplified-installer": true,
9090

9191
// 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) {
9898
// image installer on Fedora doesn't support kernel customizations
9999
// on RHEL we support kernel name
100100
// TODO: Remove when we unify the allowed options
101-
"image-installer": true,
102-
"live-installer": true,
101+
"image-installer": true,
102+
"minimal-installer": true,
103+
"workstation-live-installer": true,
103104
}
104105

105106
{ // empty blueprint: all image types should just have the default kernel
@@ -184,8 +185,6 @@ func TestDistro_OSTreeOptions(t *testing.T, d distro.Distro) {
184185
"edge-simplified-installer": true,
185186
"iot-ami": true,
186187
"iot-installer": true,
187-
"iot-qcow2-image": true,
188-
"iot-raw-image": true,
189188
"iot-simplified-installer": true,
190189
}
191190

pkg/distro/fedora/distro.go

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ func ostreeDeploymentKernelOptions() []string {
7070
// Image Definitions
7171
func mkImageInstallerImgType(d distribution) imageType {
7272
return imageType{
73-
name: "image-installer",
74-
nameAliases: []string{"fedora-image-installer"},
73+
name: "minimal-installer",
74+
nameAliases: []string{"image-installer", "fedora-image-installer"},
7575
filename: "installer.iso",
7676
mimeType: "application/x-iso9660-image",
7777
packageSets: map[string]packageSetFunc{
7878
osPkgsKey: func(t *imageType) (rpmmd.PackageSet, error) {
7979
// use the minimal raw image type for the OS package set
80-
return defs.PackageSet(t, "minimal-raw", VersionReplacements())
80+
return defs.PackageSet(t, "minimal-raw-xz", VersionReplacements())
8181
},
8282
installerPkgsKey: packageSetLoader,
8383
},
@@ -99,8 +99,8 @@ func mkImageInstallerImgType(d distribution) imageType {
9999

100100
func mkLiveInstallerImgType(d distribution) imageType {
101101
return imageType{
102-
name: "live-installer",
103-
nameAliases: []string{},
102+
name: "workstation-live-installer",
103+
nameAliases: []string{"live-installer"},
104104
filename: "live-installer.iso",
105105
mimeType: "application/x-iso9660-image",
106106
packageSets: map[string]packageSetFunc{
@@ -249,8 +249,8 @@ func mkIotSimplifiedInstallerImgType(d distribution) imageType {
249249

250250
func mkIotRawImgType(d distribution) imageType {
251251
return imageType{
252-
name: "iot-raw-image",
253-
nameAliases: []string{"fedora-iot-raw-image"},
252+
name: "iot-raw-xz",
253+
nameAliases: []string{"iot-raw-image", "fedora-iot-raw-image"},
254254
filename: "image.raw.xz",
255255
compression: "xz",
256256
mimeType: "application/xz",
@@ -282,7 +282,8 @@ func mkIotRawImgType(d distribution) imageType {
282282

283283
func mkIotQcow2ImgType(d distribution) imageType {
284284
return imageType{
285-
name: "iot-qcow2-image",
285+
name: "iot-qcow2",
286+
nameAliases: []string{"iot-qcow2-image"}, // kept for backwards compatibility
286287
filename: "image.qcow2",
287288
mimeType: "application/x-qemu-disk",
288289
packageSets: map[string]packageSetFunc{},
@@ -309,7 +310,8 @@ func mkIotQcow2ImgType(d distribution) imageType {
309310

310311
func mkQcow2ImgType(d distribution) imageType {
311312
return imageType{
312-
name: "qcow2",
313+
name: "server-qcow2",
314+
nameAliases: []string{"qcow2"}, // kept for backwards compatibility
313315
filename: "disk.qcow2",
314316
mimeType: "application/x-qemu-disk",
315317
environment: &environment.KVM{},
@@ -344,9 +346,10 @@ var (
344346

345347
func mkVmdkImgType(d distribution) imageType {
346348
return imageType{
347-
name: "vmdk",
348-
filename: "disk.vmdk",
349-
mimeType: "application/x-vmdk",
349+
name: "server-vmdk",
350+
nameAliases: []string{"vmdk"}, // kept for backwards compatibility
351+
filename: "disk.vmdk",
352+
mimeType: "application/x-vmdk",
350353
packageSets: map[string]packageSetFunc{
351354
osPkgsKey: packageSetLoader,
352355
},
@@ -364,9 +367,10 @@ func mkVmdkImgType(d distribution) imageType {
364367

365368
func mkOvaImgType(d distribution) imageType {
366369
return imageType{
367-
name: "ova",
368-
filename: "image.ova",
369-
mimeType: "application/ovf",
370+
name: "server-ova",
371+
nameAliases: []string{"ova"}, // kept for backwards compatibility
372+
filename: "image.ova",
373+
mimeType: "application/ovf",
370374
packageSets: map[string]packageSetFunc{
371375
osPkgsKey: packageSetLoader,
372376
},
@@ -407,9 +411,10 @@ func mkContainerImgType(d distribution) imageType {
407411

408412
func mkWslImgType(d distribution) imageType {
409413
return imageType{
410-
name: "wsl",
411-
filename: "wsl.tar",
412-
mimeType: "application/x-tar",
414+
name: "server-wsl",
415+
nameAliases: []string{"wsl"}, // kept for backwards compatibility
416+
filename: "wsl.tar",
417+
mimeType: "application/x-tar",
413418
packageSets: map[string]packageSetFunc{
414419
osPkgsKey: packageSetLoader,
415420
},
@@ -447,7 +452,8 @@ func mkWslImgType(d distribution) imageType {
447452

448453
func mkMinimalRawImgType(d distribution) imageType {
449454
it := imageType{
450-
name: "minimal-raw",
455+
name: "minimal-raw-xz",
456+
nameAliases: []string{"minimal-raw"}, // kept for backwards compatibility
451457
filename: "disk.raw.xz",
452458
compression: "xz",
453459
mimeType: "application/xz",
@@ -691,21 +697,25 @@ func newDistro(version int) distro.Distro {
691697
qcow2ImgType := mkQcow2ImgType(rd)
692698

693699
ociImgType := qcow2ImgType
694-
ociImgType.name = "oci"
700+
ociImgType.name = "server-oci"
701+
ociImgType.nameAliases = []string{"oci"} // kept for backwards compatibility
695702

696703
amiImgType := qcow2ImgType
697-
amiImgType.name = "ami"
704+
amiImgType.name = "server-ami"
705+
amiImgType.nameAliases = []string{"ami"} // kept for backwards compatibility
698706
amiImgType.filename = "image.raw"
699707
amiImgType.mimeType = "application/octet-stream"
700708
amiImgType.payloadPipelines = []string{"os", "image"}
701709
amiImgType.exports = []string{"image"}
702710
amiImgType.environment = &environment.EC2{}
703711

704712
openstackImgType := qcow2ImgType
705-
openstackImgType.name = "openstack"
713+
openstackImgType.name = "server-openstack"
714+
openstackImgType.nameAliases = []string{"openstack"} // kept for backwards compatibility
706715

707716
vhdImgType := qcow2ImgType
708-
vhdImgType.name = "vhd"
717+
vhdImgType.name = "server-vhd"
718+
vhdImgType.nameAliases = []string{"vhd"} // kept for backwards compatibility
709719
vhdImgType.filename = "disk.vhd"
710720
vhdImgType.mimeType = "application/x-vhd"
711721
vhdImgType.payloadPipelines = []string{"os", "image", "vpc"}
@@ -725,6 +735,7 @@ func newDistro(version int) distro.Distro {
725735

726736
minimalrawZstdImgType := mkMinimalRawImgType(rd)
727737
minimalrawZstdImgType.name = "minimal-raw-zst"
738+
minimalrawZstdImgType.nameAliases = []string{}
728739
minimalrawZstdImgType.filename = "disk.raw.zst"
729740
minimalrawZstdImgType.mimeType = "application/zstd"
730741
minimalrawZstdImgType.compression = "zstd"

0 commit comments

Comments
 (0)