Skip to content

Commit

Permalink
Merge pull request #8924 from hakman/automated-cherry-pick-of-#8727-u…
Browse files Browse the repository at this point in the history
…pstream-release-1.17

Automated cherry pick of #8727: Add support for Ubuntu 20.04 (Focal)
  • Loading branch information
k8s-ci-robot authored Apr 16, 2020
2 parents 4ef7f9c + 8a7e56b commit a3e4f51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions nodeup/pkg/distros/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
DistributionDebian10 Distribution = "buster"
DistributionXenial Distribution = "xenial"
DistributionBionic Distribution = "bionic"
DistributionFocal Distribution = "focal"
DistributionRhel7 Distribution = "rhel7"
DistributionCentos7 Distribution = "centos7"
DistributionRhel8 Distribution = "rhel8"
Expand All @@ -50,6 +51,8 @@ func (d Distribution) BuildTags() []string {
t = []string{"_xenial"}
case DistributionBionic:
t = []string{"_bionic"}
case DistributionFocal:
t = []string{"_focal"}
case DistributionCentos7:
t = []string{"_centos7"}
case DistributionRhel7:
Expand Down Expand Up @@ -86,7 +89,7 @@ func (d Distribution) IsDebianFamily() bool {
switch d {
case DistributionJessie, DistributionDebian9, DistributionDebian10:
return true
case DistributionXenial, DistributionBionic:
case DistributionXenial, DistributionBionic, DistributionFocal:
return true
case DistributionCentos7, DistributionRhel7:
return false
Expand All @@ -102,7 +105,7 @@ func (d Distribution) IsUbuntu() bool {
switch d {
case DistributionJessie, DistributionDebian9, DistributionDebian10:
return false
case DistributionXenial, DistributionBionic:
case DistributionXenial, DistributionBionic, DistributionFocal:
return true
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8:
return false
Expand All @@ -118,7 +121,7 @@ func (d Distribution) IsRHELFamily() bool {
switch d {
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8:
return true
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionDebian9, DistributionDebian10:
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionFocal, DistributionDebian9, DistributionDebian10:
return false
case DistributionCoreOS, DistributionFlatcar, DistributionContainerOS:
return false
Expand All @@ -130,7 +133,7 @@ func (d Distribution) IsRHELFamily() bool {

func (d Distribution) IsSystemd() bool {
switch d {
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionDebian9, DistributionDebian10:
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionFocal, DistributionDebian9, DistributionDebian10:
return true
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8:
return true
Expand Down
4 changes: 2 additions & 2 deletions nodeup/pkg/distros/identify.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ func FindDistribution(rootfs string) (Distribution, error) {
if line == "DISTRIB_CODENAME=xenial" {
return DistributionXenial, nil
} else if line == "DISTRIB_CODENAME=bionic" {
klog.Warningf("bionic is not fully supported nor tested for Kops and Kubernetes")
klog.Warningf("this should only be used for testing purposes.")
return DistributionBionic, nil
} else if line == "DISTRIB_CODENAME=focal" {
return DistributionFocal, nil
}
}
} else if !os.IsNotExist(err) {
Expand Down
6 changes: 4 additions & 2 deletions nodeup/pkg/model/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,10 @@ func (b *KubeletBuilder) buildKubeletConfigSpec() (*kops.KubeletConfigSpec, erro

// In certain configurations systemd-resolved will put the loopback address 127.0.0.53 as a nameserver into /etc/resolv.conf
// https://github.com/coredns/coredns/blob/master/plugin/loop/README.md#troubleshooting-loops-in-kubernetes-clusters
if b.Distribution == distros.DistributionBionic && c.ResolverConfig == nil {
c.ResolverConfig = s("/run/systemd/resolve/resolv.conf")
if c.ResolverConfig == nil {
if b.Distribution == distros.DistributionBionic || b.Distribution == distros.DistributionFocal {
c.ResolverConfig = s("/run/systemd/resolve/resolv.conf")
}
}

// As of 1.16 we can no longer set critical labels.
Expand Down

0 comments on commit a3e4f51

Please sign in to comment.