mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Merge pull request #56955 from feiskyer/scrub-dns
Automatic merge from submit-queue (batch tested with PRs 56997, 57008, 56984, 56975, 56955). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove unused ScrubDNS interface from cloudprovider **What this PR does / why we need it**: DNS scrubber from kubelet has been removed in #36785 and cloudprovider's `ScrubDNS()` interface is not used anywhere. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #56953. **Special notes for your reviewer**: **Release note**: ```release-note Remove ScrubDNS interface from cloudprovider. ```
This commit is contained in:
commit
2ae99cf146
@ -44,8 +44,6 @@ type Interface interface {
|
|||||||
Routes() (Routes, bool)
|
Routes() (Routes, bool)
|
||||||
// ProviderName returns the cloud provider ID.
|
// ProviderName returns the cloud provider ID.
|
||||||
ProviderName() string
|
ProviderName() string
|
||||||
// ScrubDNS provides an opportunity for cloud-provider-specific code to process DNS settings for pods.
|
|
||||||
ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)
|
|
||||||
// HasClusterID returns true if a ClusterID is required and set
|
// HasClusterID returns true if a ClusterID is required and set
|
||||||
HasClusterID() bool
|
HasClusterID() bool
|
||||||
}
|
}
|
||||||
|
@ -1135,11 +1135,6 @@ func (c *Cloud) ProviderName() string {
|
|||||||
return ProviderName
|
return ProviderName
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (c *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// LoadBalancer returns an implementation of LoadBalancer for Amazon Web Services.
|
// LoadBalancer returns an implementation of LoadBalancer for Amazon Web Services.
|
||||||
func (c *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
|
func (c *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
|
||||||
return c, true
|
return c, true
|
||||||
|
@ -489,11 +489,6 @@ func (az *Cloud) Routes() (cloudprovider.Routes, bool) {
|
|||||||
return az, true
|
return az, true
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS provides an opportunity for cloud-provider-specific code to process DNS settings for pods.
|
|
||||||
func (az *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (az *Cloud) HasClusterID() bool {
|
func (az *Cloud) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -181,11 +181,6 @@ func (cs *CSCloud) ProviderName() string {
|
|||||||
return ProviderName
|
return ProviderName
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (cs *CSCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (cs *CSCloud) HasClusterID() bool {
|
func (cs *CSCloud) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -110,11 +110,6 @@ func (f *FakeCloud) ProviderName() string {
|
|||||||
return f.Provider
|
return f.Provider
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (f *FakeCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (f *FakeCloud) HasClusterID() bool {
|
func (f *FakeCloud) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -20,7 +20,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -667,20 +666,6 @@ func (gce *GCECloud) updateNodeZones(prevNode, newNode *v1.Node) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Known-useless DNS search path.
|
|
||||||
var uselessDNSSearchRE = regexp.MustCompile(`^[0-9]+.google.internal.$`)
|
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (gce *GCECloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
// GCE has too many search paths by default. Filter the ones we know are useless.
|
|
||||||
for _, s := range searches {
|
|
||||||
if !uselessDNSSearchRE.MatchString(s) {
|
|
||||||
srchOut = append(srchOut, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nameservers, srchOut
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (gce *GCECloud) HasClusterID() bool {
|
func (gce *GCECloud) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -175,42 +175,6 @@ func TestComparingHostURLs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestScrubDNS(t *testing.T) {
|
|
||||||
tcs := []struct {
|
|
||||||
nameserversIn []string
|
|
||||||
searchesIn []string
|
|
||||||
nameserversOut []string
|
|
||||||
searchesOut []string
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
nameserversIn: []string{"1.2.3.4", "5.6.7.8"},
|
|
||||||
nameserversOut: []string{"1.2.3.4", "5.6.7.8"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
searchesIn: []string{"c.prj.internal.", "12345678910.google.internal.", "google.internal."},
|
|
||||||
searchesOut: []string{"c.prj.internal.", "google.internal."},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
searchesIn: []string{"c.prj.internal.", "12345678910.google.internal.", "zone.c.prj.internal.", "google.internal."},
|
|
||||||
searchesOut: []string{"c.prj.internal.", "zone.c.prj.internal.", "google.internal."},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
searchesIn: []string{"c.prj.internal.", "12345678910.google.internal.", "zone.c.prj.internal.", "google.internal.", "unexpected"},
|
|
||||||
searchesOut: []string{"c.prj.internal.", "zone.c.prj.internal.", "google.internal.", "unexpected"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
gce := &GCECloud{}
|
|
||||||
for i := range tcs {
|
|
||||||
n, s := gce.ScrubDNS(tcs[i].nameserversIn, tcs[i].searchesIn)
|
|
||||||
if !reflect.DeepEqual(n, tcs[i].nameserversOut) {
|
|
||||||
t.Errorf("Expected %v, got %v", tcs[i].nameserversOut, n)
|
|
||||||
}
|
|
||||||
if !reflect.DeepEqual(s, tcs[i].searchesOut) {
|
|
||||||
t.Errorf("Expected %v, got %v", tcs[i].searchesOut, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestSplitProviderID(t *testing.T) {
|
func TestSplitProviderID(t *testing.T) {
|
||||||
providers := []struct {
|
providers := []struct {
|
||||||
providerID string
|
providerID string
|
||||||
|
@ -486,11 +486,6 @@ func (os *OpenStack) ProviderName() string {
|
|||||||
return ProviderName
|
return ProviderName
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (os *OpenStack) ScrubDNS(nameServers, searches []string) ([]string, []string) {
|
|
||||||
return nameServers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (os *OpenStack) HasClusterID() bool {
|
func (os *OpenStack) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -128,11 +128,6 @@ func (v *OVirtCloud) ProviderName() string {
|
|||||||
return ProviderName
|
return ProviderName
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (v *OVirtCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (v *OVirtCloud) HasClusterID() bool {
|
func (v *OVirtCloud) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -546,11 +546,6 @@ func (pc *PCCloud) Routes() (cloudprovider.Routes, bool) {
|
|||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (pc *PCCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasClusterID returns true if the cluster has a clusterID
|
// HasClusterID returns true if the cluster has a clusterID
|
||||||
func (pc *PCCloud) HasClusterID() bool {
|
func (pc *PCCloud) HasClusterID() bool {
|
||||||
return true
|
return true
|
||||||
|
@ -690,11 +690,6 @@ func (vs *VSphere) Routes() (cloudprovider.Routes, bool) {
|
|||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
// ScrubDNS filters DNS settings for pods.
|
|
||||||
func (vs *VSphere) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {
|
|
||||||
return nameservers, searches
|
|
||||||
}
|
|
||||||
|
|
||||||
// AttachDisk attaches given virtual disk volume to the compute running kubelet.
|
// AttachDisk attaches given virtual disk volume to the compute running kubelet.
|
||||||
func (vs *VSphere) AttachDisk(vmDiskPath string, storagePolicyName string, nodeName k8stypes.NodeName) (diskUUID string, err error) {
|
func (vs *VSphere) AttachDisk(vmDiskPath string, storagePolicyName string, nodeName k8stypes.NodeName) (diskUUID string, err error) {
|
||||||
attachDiskInternal := func(vmDiskPath string, storagePolicyName string, nodeName k8stypes.NodeName) (diskUUID string, err error) {
|
attachDiskInternal := func(vmDiskPath string, storagePolicyName string, nodeName k8stypes.NodeName) (diskUUID string, err error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user