Skip to content

Commit 893a283

Browse files
committed
imagetypes: mark rpm based ISOs as legacy
We want to move into a world where we build the anaconda image from bootc containers instead of our current RPM based construction [0] so lets mark the rpm based installer ISO image types as legacy. This should make it easy to support a potential new `bootc-iso` or `bootc-installer` image type [0] while still supporting the legacy mode for a while.
1 parent 92ac06b commit 893a283

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

bib/cmd/bootc-image-builder/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ func manifestFromCobra(cmd *cobra.Command, args []string, pbar progress.Progress
149149

150150
// Note that we only need to pass a single imgType here into the manifest generation because:
151151
// 1. the bootc disk manifests contains exports for all supported image types
152-
// 2. the bootc iso is always a single build
152+
// 2. the bootc legacy types (iso, anaconda-iso) always do a single build
153153
imgType := imgTypes[0]
154-
if imageTypes.BuildsISO() {
155-
return manifestFromCobraForISO(imgref, buildImgref, imgType, rootFs, rpmCacheRoot, config, useLibrepo, cntArch)
154+
if imageTypes.Legacy() {
155+
return manifestFromCobraForLegacyISO(imgref, buildImgref, imgType, rootFs, rpmCacheRoot, config, useLibrepo, cntArch)
156156
}
157157
return manifestFromCobraForDisk(imgref, buildImgref, imgType, rootFs, rpmCacheRoot, config, useLibrepo, cntArch)
158158
}

bib/internal/imagetypes/imagetypes.go

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,22 @@ import (
1010
type imageType struct {
1111
Export string
1212
ISO bool
13+
Legacy bool
1314
}
1415

1516
var supportedImageTypes = map[string]imageType{
16-
"ami": imageType{Export: "image"},
17-
"qcow2": imageType{Export: "qcow2"},
18-
"raw": imageType{Export: "image"},
19-
"vmdk": imageType{Export: "vmdk"},
20-
"vhd": imageType{Export: "vpc"},
21-
"gce": imageType{Export: "gce"},
22-
"anaconda-iso": imageType{Export: "bootiso", ISO: true},
23-
"iso": imageType{Export: "bootiso", ISO: true},
17+
// XXX: ideally we would look how to consolidate all
18+
// knownledge about disk based image types into the images
19+
// library
20+
"ami": imageType{Export: "image"},
21+
"qcow2": imageType{Export: "qcow2"},
22+
"raw": imageType{Export: "image"},
23+
"vmdk": imageType{Export: "vmdk"},
24+
"vhd": imageType{Export: "vpc"},
25+
"gce": imageType{Export: "gce"},
26+
// the iso image types are RPM based and legacy/deprecated
27+
"anaconda-iso": imageType{Export: "bootiso", ISO: true, Legacy: true},
28+
"iso": imageType{Export: "bootiso", ISO: true, Legacy: true},
2429
}
2530

2631
// Available() returns a comma-separated list of supported image types
@@ -86,3 +91,12 @@ func (it ImageTypes) BuildsISO() bool {
8691
// XXX: this assumes a valid ImagTypes object
8792
return supportedImageTypes[it[0]].ISO
8893
}
94+
95+
func (it ImageTypes) Legacy() bool {
96+
for _, name := range it {
97+
if supportedImageTypes[name].Legacy {
98+
return true
99+
}
100+
}
101+
return false
102+
}

0 commit comments

Comments
 (0)