fix(amazon): use major version for checking eol, security advisories (#1873)

This commit is contained in:
MaineK00n
2024-03-18 16:13:54 +09:00
committed by GitHub
parent 426eb53af5
commit e1df74cbc1
5 changed files with 55 additions and 5 deletions

View File

@@ -459,7 +459,7 @@ func majorDotMinor(osVer string) (majorDotMinor string) {
}
func getAmazonLinuxVersion(osRelease string) string {
switch s := strings.Fields(osRelease)[0]; s {
switch s := strings.Fields(osRelease)[0]; major(s) {
case "1":
return "1"
case "2":

View File

@@ -814,6 +814,10 @@ func Test_getAmazonLinuxVersion(t *testing.T) {
release: "2023",
want: "2023",
},
{
release: "2023.3.20240312",
want: "2023",
},
{
release: "2025",
want: "2025",