Skip to content

Commit

Permalink
distro/rhel: use dot to separate minor version in distro name
Browse files Browse the repository at this point in the history
Let's be consistent and use the dot in the distro name to separate major
and minor version.

Signed-off-by: Tomáš Hozza <[email protected]>
  • Loading branch information
thozza committed Dec 20, 2023
1 parent f23f2b0 commit 0f0a0d1
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion pkg/distro/rhel7/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func newDistro(name string, minor int) *distribution {
switch name {
case "rhel":
rd = distribution{
name: fmt.Sprintf("rhel-7%d", minor),
name: fmt.Sprintf("rhel-7.%d", minor),
product: "Red Hat Enterprise Linux",
osVersion: fmt.Sprintf("7.%d", minor),
nick: "Maipo",
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel7/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func TestRhel7_GetArch(t *testing.T) {

func TestRhel7_Name(t *testing.T) {
distro := rhelFamilyDistros[0].distro
assert.Equal(t, "rhel-79", distro.Name())
assert.Equal(t, "rhel-7.9", distro.Name())
}

func TestRhel7_ModulePlatformID(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel8/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func newDistro(name string, minor int) *distribution {
switch name {
case "rhel":
rd = distribution{
name: fmt.Sprintf("rhel-8%d", minor),
name: fmt.Sprintf("rhel-8.%d", minor),
product: "Red Hat Enterprise Linux",
osVersion: fmt.Sprintf("8.%d", minor),
releaseVersion: "8",
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel8/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ func TestRHEL8_GetArch(t *testing.T) {

func TestRhel8_Name(t *testing.T) {
distro := rhelFamilyDistros[0].distro
assert.Equal(t, "rhel-810", distro.Name())
assert.Equal(t, "rhel-8.10", distro.Name())
}

func TestRhel8_ModulePlatformID(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel9/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func newDistro(name string, minor int) *distribution {
switch name {
case "rhel":
rd = distribution{
name: fmt.Sprintf("rhel-9%d", minor),
name: fmt.Sprintf("rhel-9.%d", minor),
product: "Red Hat Enterprise Linux",
osVersion: fmt.Sprintf("9.%d", minor),
releaseVersion: "9",
Expand Down
2 changes: 1 addition & 1 deletion pkg/distro/rhel9/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ func TestRhel9_GetArch(t *testing.T) {

func TestRhel9_Name(t *testing.T) {
distro := rhelFamilyDistros[0].distro
assert.Equal(t, "rhel-94", distro.Name())
assert.Equal(t, "rhel-9.4", distro.Name())
}

func TestRhel9_ModulePlatformID(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions pkg/distrofactory/distrofactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ func TestGetDistroDefaultList(t *testing.T) {
testCases := []testCase{
{
strID: "rhel-7.9",
expectedDistroName: "rhel-79",
expectedDistroName: "rhel-7.9",
},
{
strID: "rhel-89",
expectedDistroName: "rhel-89",
expectedDistroName: "rhel-8.9",
},
{
strID: "rhel-8.9",
expectedDistroName: "rhel-89",
expectedDistroName: "rhel-8.9",
},
{
strID: "rhel-810",
expectedDistroName: "rhel-810",
expectedDistroName: "rhel-8.10",
},
{
strID: "rhel-8.10",
expectedDistroName: "rhel-810",
expectedDistroName: "rhel-8.10",
},
{
strID: "rhel-91",
expectedDistroName: "rhel-91",
expectedDistroName: "rhel-9.1",
},
{
strID: "rhel-9.1",
expectedDistroName: "rhel-91",
expectedDistroName: "rhel-9.1",
},
{
strID: "fedora-38",
Expand Down
64 changes: 32 additions & 32 deletions test/config-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
"./configs/all-with-oscap.json": {
"distros": [
"rhel-91",
"rhel-92",
"rhel-87",
"rhel-88",
"rhel-89",
"rhel-9.1",
"rhel-9.2",
"rhel-8.7",
"rhel-8.8",
"rhel-8.9",
"centos*",
"fedora*"
],
Expand All @@ -26,10 +26,10 @@
},
"./configs/all-with-fips.json": {
"distros": [
"rhel-93",
"rhel-94",
"rhel-89",
"rhel-810",
"rhel-9.3",
"rhel-9.4",
"rhel-8.9",
"rhel-8.10",
"centos*",
"fedora*"
],
Expand All @@ -39,7 +39,7 @@
},
"./configs/disable-lm_sensors.json": {
"distros": [
"rhel-84"
"rhel-8.4"
],
"image-types": [
"ec2-sap"
Expand All @@ -52,8 +52,8 @@
},
"./configs/edge-ostree-pull-device-fips.json": {
"distros": [
"rhel-93",
"rhel-94"
"rhel-9.3",
"rhel-9.4"
],
"image-types": [
"edge-simplified-installer"
Expand All @@ -66,10 +66,10 @@
"edge-vsphere"
]
},
"./configs/edge-ostree-pull-fips.json": {
"./configs/edge-ostree-pull-fips.json": {
"distros": [
"rhel-93",
"rhel-94"
"rhel-9.3",
"rhel-9.4"
],
"image-types": [
"edge-installer",
Expand All @@ -84,8 +84,8 @@
},
"./configs/edge-ostree-pull-user-fips.json": {
"distros": [
"rhel-93",
"rhel-94"
"rhel-9.3",
"rhel-9.4"
],
"image-types": [
"edge-ami"
Expand Down Expand Up @@ -188,18 +188,18 @@
"fedora-38",
"fedora-39",
"fedora-40",
"rhel-79",
"rhel-810",
"rhel-85",
"rhel-86",
"rhel-87",
"rhel-88",
"rhel-89",
"rhel-90",
"rhel-91",
"rhel-92",
"rhel-93",
"rhel-94"
"rhel-7.9",
"rhel-8.10",
"rhel-8.5",
"rhel-8.6",
"rhel-8.7",
"rhel-8.8",
"rhel-8.9",
"rhel-9.0",
"rhel-9.1",
"rhel-9.2",
"rhel-9.3",
"rhel-9.4"
],
"image-types": [
"ec2-sap"
Expand All @@ -213,9 +213,9 @@
"simplified-installer"
],
"distros": [
"rhel-92",
"rhel-93",
"rhel-94"
"rhel-9.2",
"rhel-9.3",
"rhel-9.4"
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0f0a0d1

Please sign in to comment.