Skip to content

Commit ea517bf

Browse files
committed
image: set UseRHELLoraxTemplates only on rhel/centos/eln
This commit flips the detection if we need the rhel lorax template. It will only use it when it detect running on rhel/centos/eln. This should help with the common case of distros that need the generic lorax template but do not set the name to fedora.
1 parent c53bca9 commit ea517bf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"math"
88
"math/big"
99
"math/rand"
10+
"slices"
1011
"strconv"
1112
"strings"
1213

@@ -435,6 +436,10 @@ func labelForISO(os *source.OSRelease, arch *arch.Arch) string {
435436
}
436437
}
437438

439+
func needsRHELLoraxTemplates(si source.OSRelease) bool {
440+
return si.ID == "rhel" || slices.Contains(si.IDLike, "rhel") || si.VersionID == "eln"
441+
}
442+
438443
func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, error) {
439444
if c.Imgref == "" {
440445
return nil, fmt.Errorf("pipeline: no base image defined")
@@ -498,9 +503,7 @@ func manifestForISO(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest, erro
498503
img.Kickstart.OSTree = &kickstart.OSTree{
499504
OSName: "default",
500505
}
501-
// use lorax-templates-rhel if the source distro is not Fedora with the exception of Fedora ELN
502-
img.UseRHELLoraxTemplates =
503-
c.SourceInfo.OSRelease.ID != "fedora" || c.SourceInfo.OSRelease.VersionID == "eln"
506+
img.UseRHELLoraxTemplates = needsRHELLoraxTemplates(c.SourceInfo.OSRelease)
504507

505508
switch c.Architecture {
506509
case arch.ARCH_X86_64:

0 commit comments

Comments
 (0)