Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
65efeee6
Commit
65efeee6
authored
Dec 08, 2017
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused ScrubDNS interface from cloudprovider
parent
a505d1bc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
0 additions
and
93 deletions
+0
-93
cloud.go
pkg/cloudprovider/cloud.go
+0
-2
aws.go
pkg/cloudprovider/providers/aws/aws.go
+0
-5
azure.go
pkg/cloudprovider/providers/azure/azure.go
+0
-5
cloudstack.go
pkg/cloudprovider/providers/cloudstack/cloudstack.go
+0
-5
fake.go
pkg/cloudprovider/providers/fake/fake.go
+0
-5
gce.go
pkg/cloudprovider/providers/gce/gce.go
+0
-15
gce_test.go
pkg/cloudprovider/providers/gce/gce_test.go
+0
-36
openstack.go
pkg/cloudprovider/providers/openstack/openstack.go
+0
-5
ovirt.go
pkg/cloudprovider/providers/ovirt/ovirt.go
+0
-5
photon.go
pkg/cloudprovider/providers/photon/photon.go
+0
-5
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+0
-5
No files found.
pkg/cloudprovider/cloud.go
View file @
65efeee6
...
...
@@ -44,8 +44,6 @@ type Interface interface {
Routes
()
(
Routes
,
bool
)
// ProviderName returns the cloud provider ID.
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
()
bool
}
...
...
pkg/cloudprovider/providers/aws/aws.go
View file @
65efeee6
...
...
@@ -1135,11 +1135,6 @@ func (c *Cloud) ProviderName() string {
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.
func
(
c
*
Cloud
)
LoadBalancer
()
(
cloudprovider
.
LoadBalancer
,
bool
)
{
return
c
,
true
...
...
pkg/cloudprovider/providers/azure/azure.go
View file @
65efeee6
...
...
@@ -489,11 +489,6 @@ func (az *Cloud) Routes() (cloudprovider.Routes, bool) {
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
func
(
az
*
Cloud
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/cloudstack/cloudstack.go
View file @
65efeee6
...
...
@@ -181,11 +181,6 @@ func (cs *CSCloud) ProviderName() string {
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
func
(
cs
*
CSCloud
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/fake/fake.go
View file @
65efeee6
...
...
@@ -110,11 +110,6 @@ func (f *FakeCloud) ProviderName() string {
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
func
(
f
*
FakeCloud
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/gce/gce.go
View file @
65efeee6
...
...
@@ -20,7 +20,6 @@ import (
"fmt"
"io"
"net/http"
"regexp"
"runtime"
"strconv"
"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
func
(
gce
*
GCECloud
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/gce/gce_test.go
View file @
65efeee6
...
...
@@ -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
)
{
providers
:=
[]
struct
{
providerID
string
...
...
pkg/cloudprovider/providers/openstack/openstack.go
View file @
65efeee6
...
...
@@ -486,11 +486,6 @@ func (os *OpenStack) ProviderName() string {
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
func
(
os
*
OpenStack
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/ovirt/ovirt.go
View file @
65efeee6
...
...
@@ -128,11 +128,6 @@ func (v *OVirtCloud) ProviderName() string {
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
func
(
v
*
OVirtCloud
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/photon/photon.go
View file @
65efeee6
...
...
@@ -546,11 +546,6 @@ func (pc *PCCloud) Routes() (cloudprovider.Routes, bool) {
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
func
(
pc
*
PCCloud
)
HasClusterID
()
bool
{
return
true
...
...
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
65efeee6
...
...
@@ -689,11 +689,6 @@ func (vs *VSphere) Routes() (cloudprovider.Routes, bool) {
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.
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment