rhel84: panic if kernel not defined in installer

This commit is contained in:
Achilleas Koutsou 2022-04-05 02:41:21 +02:00 committed by Christian Kellner
parent a76f7a64dc
commit 23d4281349

View file

@ -256,14 +256,18 @@ func (t *imageTypeS2) pipelines(customizations *blueprint.Customizations, option
pipelines = append(pipelines, *t.buildPipeline(repos, packageSetSpecs["build-packages"]))
if t.bootISO {
var kernelPkg rpmmd.PackageSpec
for _, pkg := range packageSetSpecs["installer"] {
var kernelPkg *rpmmd.PackageSpec
installerPackages := packageSetSpecs["installer"]
for idx := range installerPackages {
pkg := installerPackages[idx]
if pkg.Name == "kernel" {
kernelPkg = pkg
kernelPkg = &pkg
break
}
}
// TODO: panic if not found
if kernelPkg == nil {
panic("kernel package not found in installer package set; this is a programming error")
}
kernelVer := fmt.Sprintf("%s-%s.%s", kernelPkg.Version, kernelPkg.Release, kernelPkg.Arch)
anacondaPipeline, err := t.anacondaTreePipeline(repos, customizations, packageSetSpecs["installer"], options, kernelVer)
if err != nil {