feat(amazon): support amazon linux 2022 (#1338)

This commit is contained in:
MaineK00n
2021-12-09 11:06:44 +09:00
committed by GitHub
parent 0c6a892893
commit 2b7294a504
8 changed files with 61 additions and 33 deletions

View File

@@ -301,10 +301,7 @@ func (l Distro) String() string {
// MajorVersion returns Major version
func (l Distro) MajorVersion() (int, error) {
if l.Family == constant.Amazon {
if isAmazonLinux1(l.Release) {
return 1, nil
}
return 2, nil
return strconv.Atoi(getAmazonLinuxVersion(l.Release))
}
if 0 < len(l.Release) {
return strconv.Atoi(strings.Split(l.Release, ".")[0])