mirror of https://github.com/kubernetes/kops.git
Treat Amazon Linux 2 as CentOS 7
This commit is contained in:
parent
1924ce0d50
commit
619ef0da8e
|
|
@ -89,7 +89,7 @@ func FindDistribution(rootfs string) (Distribution, error) {
|
|||
glog.Warningf("error reading /usr/lib/os-release: %v", err)
|
||||
}
|
||||
|
||||
// ContainerOS uses /etc/os-release
|
||||
// ContainerOS, Amazon Linux 2 uses /etc/os-release
|
||||
osRelease, err := ioutil.ReadFile(path.Join(rootfs, "etc/os-release"))
|
||||
if err == nil {
|
||||
for _, line := range strings.Split(string(osRelease), "\n") {
|
||||
|
|
@ -97,6 +97,9 @@ func FindDistribution(rootfs string) (Distribution, error) {
|
|||
if line == "ID=cos" {
|
||||
return DistributionContainerOS, nil
|
||||
}
|
||||
if strings.HasPrefix(line, "PRETTY_NAME=\"Amazon Linux 2") {
|
||||
return DistributionCentos7, nil
|
||||
}
|
||||
}
|
||||
glog.Warningf("unhandled /etc/os-release info %q", string(osRelease))
|
||||
} else if !os.IsNotExist(err) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue