distro/rhel86: distro private method isRHEL()
Returns true if the distribution name starts with "rhel". Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
parent
c7df2f1bc7
commit
93750dd537
2 changed files with 6 additions and 3 deletions
|
|
@ -124,6 +124,10 @@ func (d *distribution) addArches(arches ...architecture) {
|
|||
}
|
||||
}
|
||||
|
||||
func (d *distribution) isRHEL() bool {
|
||||
return strings.HasPrefix(d.name, "rhel")
|
||||
}
|
||||
|
||||
type architecture struct {
|
||||
distro *distribution
|
||||
name string
|
||||
|
|
@ -872,7 +876,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
ppc64le.addImageTypes(qcow2ImgType, tarImgType)
|
||||
s390x.addImageTypes(qcow2ImgType, tarImgType)
|
||||
|
||||
if strings.HasPrefix(distroName, "rhel") {
|
||||
if rd.isRHEL() {
|
||||
// add ec2 image types to RHEL distro only
|
||||
x86_64.addImageTypes(ec2ImgTypeX86_64, ec2HaImgTypeX86_64, ec2SapImgTypeX86_64)
|
||||
aarch64.addImageTypes(ec2ImgTypeAarch64)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ package rhel86
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/rpmmd"
|
||||
|
|
@ -505,7 +504,7 @@ func bareMetalPackageSet(t *imageType) rpmmd.PackageSet {
|
|||
|
||||
// packages that are only in some (sub)-distributions
|
||||
func distroSpecificPackageSet(t *imageType) rpmmd.PackageSet {
|
||||
if strings.HasPrefix(t.Arch().Distro().Name(), "rhel") {
|
||||
if t.arch.distro.isRHEL() {
|
||||
return rpmmd.PackageSet{
|
||||
Include: []string{"insights-client"},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue