mirror of https://github.com/kubernetes/kops.git
check /run/systemd/resolve/resolv.conf inside HasLoopbackEtcResolvConf
This commit is contained in:
parent
c67030384b
commit
82c2015a45
|
@ -18,6 +18,7 @@ package distributions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Distribution represents a particular version of an operating system.
|
// Distribution represents a particular version of an operating system.
|
||||||
|
@ -98,13 +99,14 @@ func (d *Distribution) DefaultUsers() ([]string, error) {
|
||||||
// See https://github.com/coredns/coredns/blob/master/plugin/loop/README.md#troubleshooting-loops-in-kubernetes-clusters
|
// See https://github.com/coredns/coredns/blob/master/plugin/loop/README.md#troubleshooting-loops-in-kubernetes-clusters
|
||||||
func (d *Distribution) HasLoopbackEtcResolvConf() bool {
|
func (d *Distribution) HasLoopbackEtcResolvConf() bool {
|
||||||
switch d.project {
|
switch d.project {
|
||||||
case "debian":
|
|
||||||
return d.version >= 12
|
|
||||||
case "ubuntu":
|
case "ubuntu":
|
||||||
return d.version >= 18.04
|
return d.version >= 18.04
|
||||||
case "flatcar":
|
case "flatcar":
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
|
if _, err := os.Stat("/run/systemd/resolve/resolv.conf"); err == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue