Skip to content

Commit 45d3b40

Browse files
authoredNov 21, 2024··
feat(suse): Align SUSE/OpenSUSE OS Identifiers (#7965)
Signed-off-by: Jose D. Gomez R <jose.gomez@suse.com>
1 parent 9688370 commit 45d3b40

File tree

7 files changed

+151
-151
lines changed

7 files changed

+151
-151
lines changed
 

‎integration/testdata/opensuse-leap-151.json.golden

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ArtifactType": "container_image",
66
"Metadata": {
77
"OS": {
8-
"Family": "opensuse.leap",
8+
"Family": "opensuse-leap",
99
"Name": "15.1",
1010
"EOSL": true
1111
},
@@ -57,16 +57,16 @@
5757
},
5858
"Results": [
5959
{
60-
"Target": "testdata/fixtures/images/opensuse-leap-151.tar.gz (opensuse.leap 15.1)",
60+
"Target": "testdata/fixtures/images/opensuse-leap-151.tar.gz (opensuse-leap 15.1)",
6161
"Class": "os-pkgs",
62-
"Type": "opensuse.leap",
62+
"Type": "opensuse-leap",
6363
"Vulnerabilities": [
6464
{
6565
"VulnerabilityID": "openSUSE-SU-2020:0062-1",
6666
"PkgID": "libopenssl1_1@1.1.0i-lp151.8.3.1.x86_64",
6767
"PkgName": "libopenssl1_1",
6868
"PkgIdentifier": {
69-
"PURL": "pkg:rpm/opensuse/libopenssl1_1@1.1.0i-lp151.8.3.1?arch=x86_64\u0026distro=opensuse.leap-15.1",
69+
"PURL": "pkg:rpm/opensuse/libopenssl1_1@1.1.0i-lp151.8.3.1?arch=x86_64\u0026distro=opensuse-leap-15.1",
7070
"UID": "898b73ddd0412f57"
7171
},
7272
"InstalledVersion": "1.1.0i-lp151.8.3.1",
@@ -99,7 +99,7 @@
9999
"PkgID": "openssl-1_1@1.1.0i-lp151.8.3.1.x86_64",
100100
"PkgName": "openssl-1_1",
101101
"PkgIdentifier": {
102-
"PURL": "pkg:rpm/opensuse/openssl-1_1@1.1.0i-lp151.8.3.1?arch=x86_64\u0026distro=opensuse.leap-15.1",
102+
"PURL": "pkg:rpm/opensuse/openssl-1_1@1.1.0i-lp151.8.3.1?arch=x86_64\u0026distro=opensuse-leap-15.1",
103103
"UID": "58980d005de43f54"
104104
},
105105
"InstalledVersion": "1.1.0i-lp151.8.3.1",

‎integration/testdata/opensuse-tumbleweed.json.golden

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ArtifactType": "container_image",
66
"Metadata": {
77
"OS": {
8-
"Family": "opensuse.tumbleweed",
8+
"Family": "opensuse-tumbleweed",
99
"Name": "20240607"
1010
},
1111
"ImageID": "sha256:580e73f5c823232e6587136e9f5428a89afdf77a123bb8575d08208e0cc34b12",
@@ -60,16 +60,16 @@
6060
},
6161
"Results": [
6262
{
63-
"Target": "testdata/fixtures/images/opensuse-tumbleweed.tar.gz (opensuse.tumbleweed 20240607)",
63+
"Target": "testdata/fixtures/images/opensuse-tumbleweed.tar.gz (opensuse-tumbleweed 20240607)",
6464
"Class": "os-pkgs",
65-
"Type": "opensuse.tumbleweed",
65+
"Type": "opensuse-tumbleweed",
6666
"Vulnerabilities": [
6767
{
6868
"VulnerabilityID": "openSUSE-SU-2024:13065-1",
6969
"PkgID": "libopenssl3@3.1.4-9.1.x86_64",
7070
"PkgName": "libopenssl3",
7171
"PkgIdentifier": {
72-
"PURL": "pkg:rpm/opensuse/libopenssl3@3.1.4-9.1?arch=x86_64\u0026distro=opensuse.tumbleweed-20240607",
72+
"PURL": "pkg:rpm/opensuse/libopenssl3@3.1.4-9.1?arch=x86_64\u0026distro=opensuse-tumbleweed-20240607",
7373
"UID": "f051425f385d2b99"
7474
},
7575
"InstalledVersion": "3.1.4-9.1",

‎integration/testdata/sl-micro-rancher5.4.json.golden

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ArtifactType": "container_image",
66
"Metadata": {
77
"OS": {
8-
"Family": "suse linux enterprise micro",
8+
"Family": "slem",
99
"Name": "5.4"
1010
},
1111
"ImageID": "sha256:c45ec974938acac29c893b5d273d73e4ebdd7e6a97b6fa861dfbd8dd430b9016",
@@ -61,9 +61,9 @@
6161
},
6262
"Results": [
6363
{
64-
"Target": "testdata/fixtures/images/sle-micro-rancher-5.4_ndb.tar.gz (suse linux enterprise micro 5.4)",
64+
"Target": "testdata/fixtures/images/sle-micro-rancher-5.4_ndb.tar.gz (slem 5.4)",
6565
"Class": "os-pkgs",
66-
"Type": "suse linux enterprise micro"
66+
"Type": "slem"
6767
}
6868
]
6969
}

‎pkg/detector/ospkg/suse/suse_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -243,20 +243,20 @@ func TestScanner_IsSupportedVersion(t *testing.T) {
243243
want bool
244244
}{
245245
{
246-
name: "opensuse.tumbleweed",
246+
name: "opensuse-tumbleweed",
247247
now: time.Date(2019, 5, 31, 23, 59, 59, 0, time.UTC),
248248
args: args{
249-
osFamily: "opensuse.tumbleweed",
249+
osFamily: "opensuse-tumbleweed",
250250
osVer: "",
251251
},
252252
distribution: suse.OpenSUSETumbleweed,
253253
want: true,
254254
},
255255
{
256-
name: "opensuse.leap42.3",
256+
name: "opensuse-leap42.3",
257257
now: time.Date(2019, 5, 31, 23, 59, 59, 0, time.UTC),
258258
args: args{
259-
osFamily: "opensuse.leap",
259+
osFamily: "opensuse-leap",
260260
osVer: "42.3",
261261
},
262262
distribution: suse.OpenSUSE,
@@ -266,7 +266,7 @@ func TestScanner_IsSupportedVersion(t *testing.T) {
266266
name: "sles12.3",
267267
now: time.Date(2019, 5, 31, 23, 59, 59, 0, time.UTC),
268268
args: args{
269-
osFamily: "suse linux enterprise server",
269+
osFamily: "sles",
270270
osVer: "12.3",
271271
},
272272
distribution: suse.SUSEEnterpriseLinux,
@@ -276,7 +276,7 @@ func TestScanner_IsSupportedVersion(t *testing.T) {
276276
name: "latest",
277277
now: time.Date(2019, 5, 2, 23, 59, 59, 0, time.UTC),
278278
args: args{
279-
osFamily: "opensuse.leap",
279+
osFamily: "opensuse-leap",
280280
osVer: "999.0",
281281
},
282282
want: true,

‎pkg/fanal/test/integration/library_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ var tests = []testCase{
9191
imageFile: "../../../../integration/testdata/fixtures/images/opensuse-leap-151.tar.gz",
9292
wantOS: types.OS{
9393
Name: "15.1",
94-
Family: "opensuse.leap",
94+
Family: "opensuse-leap",
9595
},
9696
},
9797
{
@@ -100,7 +100,7 @@ var tests = []testCase{
100100
imageFile: "../../../../integration/testdata/fixtures/images/opensuse-tumbleweed.tar.gz",
101101
wantOS: types.OS{
102102
Name: "20240607",
103-
Family: "opensuse.tumbleweed",
103+
Family: "opensuse-tumbleweed",
104104
},
105105
},
106106
{
@@ -110,7 +110,7 @@ var tests = []testCase{
110110
imageFile: "../../../../integration/testdata/fixtures/images/suse-15.3_ndb.tar.gz",
111111
wantOS: types.OS{
112112
Name: "15.3",
113-
Family: "suse linux enterprise server",
113+
Family: "sles",
114114
},
115115
},
116116
{

‎pkg/fanal/test/integration/testdata/goldens/packages/opensuse-tumbleweed.json.golden

+126-126
Large diffs are not rendered by default.

‎pkg/fanal/types/const.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ const (
3131
Debian OSType = "debian"
3232
Fedora OSType = "fedora"
3333
OpenSUSE OSType = "opensuse"
34-
OpenSUSELeap OSType = "opensuse.leap"
35-
OpenSUSETumbleweed OSType = "opensuse.tumbleweed"
34+
OpenSUSELeap OSType = "opensuse-leap"
35+
OpenSUSETumbleweed OSType = "opensuse-tumbleweed"
3636
Oracle OSType = "oracle"
3737
Photon OSType = "photon"
3838
RedHat OSType = "redhat"
3939
Rocky OSType = "rocky"
40-
SLEMicro OSType = "suse linux enterprise micro"
41-
SLES OSType = "suse linux enterprise server"
40+
SLEMicro OSType = "slem"
41+
SLES OSType = "sles"
4242
Ubuntu OSType = "ubuntu"
4343
Wolfi OSType = "wolfi"
4444
)

0 commit comments

Comments
 (0)
Please sign in to comment.