fix(amazon): use major version for checking eol, security advisories (#1873)
This commit is contained in:
@@ -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":
|
||||
|
||||
@@ -814,6 +814,10 @@ func Test_getAmazonLinuxVersion(t *testing.T) {
|
||||
release: "2023",
|
||||
want: "2023",
|
||||
},
|
||||
{
|
||||
release: "2023.3.20240312",
|
||||
want: "2023",
|
||||
},
|
||||
{
|
||||
release: "2025",
|
||||
want: "2025",
|
||||
|
||||
Reference in New Issue
Block a user