distro: fix distro mangling for rhel-90

We want to also mangle RHEL 9 in the same style as we do 8.4+.

RHEL 8.0 => rhel-80
RHEL 8.1 => rhel-81
etc

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2021-07-27 12:25:29 +02:00 committed by Ondřej Budai
parent 7b03db05c3
commit afa267cebc

View file

@ -171,7 +171,7 @@ func GetHostDistroName() (string, bool, bool, error) {
// NOTE: We only consider major releases up until rhel 8.4
version := strings.Split(osrelease["VERSION_ID"], ".")
name := osrelease["ID"] + "-" + version[0]
if osrelease["ID"] == "rhel" && version[0] == "8" && version[1] >= "4" {
if osrelease["ID"] == "rhel" && ((version[0] == "8" && version[1] >= "4") || version[0] == "9") {
name = name + version[1]
}