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
78a93f8c
Commit
78a93f8c
authored
Mar 29, 2019
by
Kenichi Omichi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix golint failures of e2e/framework/n*.go
parent
91f40aec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
14 deletions
+20
-14
networking.go
test/e2e/common/networking.go
+4
-4
networking_utils.go
test/e2e/framework/networking_utils.go
+0
-0
nodes_util.go
test/e2e/framework/nodes_util.go
+11
-5
service_util.go
test/e2e/framework/service_util.go
+1
-1
networking.go
test/e2e/network/networking.go
+0
-0
networking.go
test/e2e/windows/networking.go
+4
-4
No files found.
test/e2e/common/networking.go
View file @
78a93f8c
...
@@ -40,7 +40,7 @@ var _ = Describe("[sig-network] Networking", func() {
...
@@ -40,7 +40,7 @@ var _ = Describe("[sig-network] Networking", func() {
framework
.
ConformanceIt
(
"should function for intra-pod communication: http [LinuxOnly] [NodeConformance]"
,
func
()
{
framework
.
ConformanceIt
(
"should function for intra-pod communication: http [LinuxOnly] [NodeConformance]"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromTestContainer
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
ttp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromTestContainer
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
TTP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
...
@@ -54,7 +54,7 @@ var _ = Describe("[sig-network] Networking", func() {
...
@@ -54,7 +54,7 @@ var _ = Describe("[sig-network] Networking", func() {
framework
.
ConformanceIt
(
"should function for intra-pod communication: udp [LinuxOnly] [NodeConformance]"
,
func
()
{
framework
.
ConformanceIt
(
"should function for intra-pod communication: udp [LinuxOnly] [NodeConformance]"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromTestContainer
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
dp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromTestContainer
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
DP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
...
@@ -68,7 +68,7 @@ var _ = Describe("[sig-network] Networking", func() {
...
@@ -68,7 +68,7 @@ var _ = Describe("[sig-network] Networking", func() {
framework
.
ConformanceIt
(
"should function for node-pod communication: http [LinuxOnly] [NodeConformance]"
,
func
()
{
framework
.
ConformanceIt
(
"should function for node-pod communication: http [LinuxOnly] [NodeConformance]"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromNode
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
ttp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromNode
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
TTP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
...
@@ -82,7 +82,7 @@ var _ = Describe("[sig-network] Networking", func() {
...
@@ -82,7 +82,7 @@ var _ = Describe("[sig-network] Networking", func() {
framework
.
ConformanceIt
(
"should function for node-pod communication: udp [LinuxOnly] [NodeConformance]"
,
func
()
{
framework
.
ConformanceIt
(
"should function for node-pod communication: udp [LinuxOnly] [NodeConformance]"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
true
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromNode
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
dp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromNode
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
DP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
})
})
...
...
test/e2e/framework/networking_utils.go
View file @
78a93f8c
This diff is collapsed.
Click to expand it.
test/e2e/framework/nodes_util.go
View file @
78a93f8c
...
@@ -30,15 +30,17 @@ import (
...
@@ -30,15 +30,17 @@ import (
clientset
"k8s.io/client-go/kubernetes"
clientset
"k8s.io/client-go/kubernetes"
)
)
func
EtcdUpgrade
(
target_storage
,
target_version
string
)
error
{
// EtcdUpgrade upgrades etcd on GCE.
func
EtcdUpgrade
(
targetStorage
,
targetVersion
string
)
error
{
switch
TestContext
.
Provider
{
switch
TestContext
.
Provider
{
case
"gce"
:
case
"gce"
:
return
etcdUpgradeGCE
(
target
_storage
,
target_v
ersion
)
return
etcdUpgradeGCE
(
target
Storage
,
targetV
ersion
)
default
:
default
:
return
fmt
.
Errorf
(
"EtcdUpgrade() is not implemented for provider %s"
,
TestContext
.
Provider
)
return
fmt
.
Errorf
(
"EtcdUpgrade() is not implemented for provider %s"
,
TestContext
.
Provider
)
}
}
}
}
// MasterUpgrade upgrades master node on GCE/GKE.
func
MasterUpgrade
(
v
string
)
error
{
func
MasterUpgrade
(
v
string
)
error
{
switch
TestContext
.
Provider
{
switch
TestContext
.
Provider
{
case
"gce"
:
case
"gce"
:
...
@@ -52,17 +54,18 @@ func MasterUpgrade(v string) error {
...
@@ -52,17 +54,18 @@ func MasterUpgrade(v string) error {
}
}
}
}
func
etcdUpgradeGCE
(
target
_storage
,
target_v
ersion
string
)
error
{
func
etcdUpgradeGCE
(
target
Storage
,
targetV
ersion
string
)
error
{
env
:=
append
(
env
:=
append
(
os
.
Environ
(),
os
.
Environ
(),
"TEST_ETCD_VERSION="
+
target
_v
ersion
,
"TEST_ETCD_VERSION="
+
target
V
ersion
,
"STORAGE_BACKEND="
+
target
_s
torage
,
"STORAGE_BACKEND="
+
target
S
torage
,
"TEST_ETCD_IMAGE=3.3.10-0"
)
"TEST_ETCD_IMAGE=3.3.10-0"
)
_
,
_
,
err
:=
RunCmdEnv
(
env
,
gceUpgradeScript
(),
"-l"
,
"-M"
)
_
,
_
,
err
:=
RunCmdEnv
(
env
,
gceUpgradeScript
(),
"-l"
,
"-M"
)
return
err
return
err
}
}
// MasterUpgradeGCEWithKubeProxyDaemonSet upgrades master node on GCE with enabling/disabling the daemon set of kube-proxy.
// TODO(mrhohn): Remove this function when kube-proxy is run as a DaemonSet by default.
// TODO(mrhohn): Remove this function when kube-proxy is run as a DaemonSet by default.
func
MasterUpgradeGCEWithKubeProxyDaemonSet
(
v
string
,
enableKubeProxyDaemonSet
bool
)
error
{
func
MasterUpgradeGCEWithKubeProxyDaemonSet
(
v
string
,
enableKubeProxyDaemonSet
bool
)
error
{
return
masterUpgradeGCE
(
v
,
enableKubeProxyDaemonSet
)
return
masterUpgradeGCE
(
v
,
enableKubeProxyDaemonSet
)
...
@@ -164,6 +167,7 @@ func masterUpgradeKubernetesAnywhere(v string) error {
...
@@ -164,6 +167,7 @@ func masterUpgradeKubernetesAnywhere(v string) error {
return
nil
return
nil
}
}
// NodeUpgrade upgrades nodes on GCE/GKE.
func
NodeUpgrade
(
f
*
Framework
,
v
string
,
img
string
)
error
{
func
NodeUpgrade
(
f
*
Framework
,
v
string
,
img
string
)
error
{
// Perform the upgrade.
// Perform the upgrade.
var
err
error
var
err
error
...
@@ -181,6 +185,7 @@ func NodeUpgrade(f *Framework, v string, img string) error {
...
@@ -181,6 +185,7 @@ func NodeUpgrade(f *Framework, v string, img string) error {
return
waitForNodesReadyAfterUpgrade
(
f
)
return
waitForNodesReadyAfterUpgrade
(
f
)
}
}
// NodeUpgradeGCEWithKubeProxyDaemonSet upgrades nodes on GCE with enabling/disabling the daemon set of kube-proxy.
// TODO(mrhohn): Remove this function when kube-proxy is run as a DaemonSet by default.
// TODO(mrhohn): Remove this function when kube-proxy is run as a DaemonSet by default.
func
NodeUpgradeGCEWithKubeProxyDaemonSet
(
f
*
Framework
,
v
string
,
img
string
,
enableKubeProxyDaemonSet
bool
)
error
{
func
NodeUpgradeGCEWithKubeProxyDaemonSet
(
f
*
Framework
,
v
string
,
img
string
,
enableKubeProxyDaemonSet
bool
)
error
{
// Perform the upgrade.
// Perform the upgrade.
...
@@ -365,6 +370,7 @@ func (k *NodeKiller) kill(nodes []v1.Node) {
...
@@ -365,6 +370,7 @@ func (k *NodeKiller) kill(nodes []v1.Node) {
wg
.
Wait
()
wg
.
Wait
()
}
}
// DeleteNodeOnCloudProvider deletes the specified node.
func
DeleteNodeOnCloudProvider
(
node
*
v1
.
Node
)
error
{
func
DeleteNodeOnCloudProvider
(
node
*
v1
.
Node
)
error
{
return
TestContext
.
CloudConfig
.
Provider
.
DeleteNode
(
node
)
return
TestContext
.
CloudConfig
.
Provider
.
DeleteNode
(
node
)
}
}
test/e2e/framework/service_util.go
View file @
78a93f8c
...
@@ -821,7 +821,7 @@ func newNetexecPodSpec(podName string, httpPort, udpPort int32, hostNetwork bool
...
@@ -821,7 +821,7 @@ func newNetexecPodSpec(podName string, httpPort, udpPort int32, hostNetwork bool
Containers
:
[]
v1
.
Container
{
Containers
:
[]
v1
.
Container
{
{
{
Name
:
"netexec"
,
Name
:
"netexec"
,
Image
:
N
etexecImageName
,
Image
:
n
etexecImageName
,
Command
:
[]
string
{
Command
:
[]
string
{
"/netexec"
,
"/netexec"
,
fmt
.
Sprintf
(
"--http-port=%d"
,
httpPort
),
fmt
.
Sprintf
(
"--http-port=%d"
,
httpPort
),
...
...
test/e2e/network/networking.go
View file @
78a93f8c
This diff is collapsed.
Click to expand it.
test/e2e/windows/networking.go
View file @
78a93f8c
...
@@ -48,7 +48,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
...
@@ -48,7 +48,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
ginkgo
.
It
(
"should function for intra-pod communication: http"
,
func
()
{
ginkgo
.
It
(
"should function for intra-pod communication: http"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromTestContainer
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
ttp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromTestContainer
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
TTP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
...
@@ -61,7 +61,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
...
@@ -61,7 +61,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
ginkgo
.
It
(
"should function for intra-pod communication: udp"
,
func
()
{
ginkgo
.
It
(
"should function for intra-pod communication: udp"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromTestContainer
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
dp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromTestContainer
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
DP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
...
@@ -74,7 +74,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
...
@@ -74,7 +74,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
ginkgo
.
It
(
"should function for node-pod communication: http"
,
func
()
{
ginkgo
.
It
(
"should function for node-pod communication: http"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromNode
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
ttp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromNode
(
"http"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointH
TTP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
...
@@ -87,7 +87,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
...
@@ -87,7 +87,7 @@ var _ = ginkgo.Describe("[sig-network] [sig-windows] Networking", func() {
ginkgo
.
It
(
"should function for node-pod communication: udp"
,
func
()
{
ginkgo
.
It
(
"should function for node-pod communication: udp"
,
func
()
{
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
config
:=
framework
.
NewCoreNetworkingTestConfig
(
f
,
false
)
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
for
_
,
endpointPod
:=
range
config
.
EndpointPods
{
config
.
DialFromNode
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
dp
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
config
.
DialFromNode
(
"udp"
,
endpointPod
.
Status
.
PodIP
,
framework
.
EndpointU
DP
Port
,
config
.
MaxTries
,
0
,
sets
.
NewString
(
endpointPod
.
Name
))
}
}
})
})
})
})
...
...
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