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
dea98cbd
Commit
dea98cbd
authored
Mar 31, 2017
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't run preserve pod IP test in userspace mode
parent
81545c29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
util.go
test/e2e/framework/util.go
+29
-0
service.go
test/e2e/service.go
+10
-0
No files found.
test/e2e/framework/util.go
View file @
dea98cbd
...
...
@@ -346,6 +346,35 @@ func NodeOSDistroIs(supportedNodeOsDistros ...string) bool {
return
false
}
func
ProxyMode
(
f
*
Framework
)
(
string
,
error
)
{
pod
:=
&
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"kube-proxy-mode-detector"
,
Namespace
:
f
.
Namespace
.
Name
,
},
Spec
:
v1
.
PodSpec
{
HostNetwork
:
true
,
Containers
:
[]
v1
.
Container
{
{
Name
:
"detector"
,
Image
:
"gcr.io/google_containers/e2e-net-amd64:1.0"
,
Command
:
[]
string
{
"/bin/sleep"
,
"3600"
},
},
},
},
}
f
.
PodClient
()
.
CreateSync
(
pod
)
defer
f
.
PodClient
()
.
DeleteSync
(
pod
.
Name
,
&
metav1
.
DeleteOptions
{},
time
.
Minute
)
cmd
:=
"curl -q -s --connect-timeout 1 http://localhost:10249/proxyMode"
stdout
,
err
:=
RunHostCmd
(
pod
.
Namespace
,
pod
.
Name
,
cmd
)
if
err
!=
nil
{
return
""
,
err
}
Logf
(
"ProxyMode: %s"
,
stdout
)
return
stdout
,
nil
}
func
SkipUnlessServerVersionGTE
(
v
*
utilversion
.
Version
,
c
discovery
.
ServerVersionInterface
)
{
gte
,
err
:=
ServerVersionGTE
(
v
,
c
)
if
err
!=
nil
{
...
...
test/e2e/service.go
View file @
dea98cbd
...
...
@@ -216,6 +216,16 @@ var _ = framework.KubeDescribe("Services", func() {
It
(
"should preserve source pod IP for traffic thru service cluster IP"
,
func
()
{
// This behavior is not supported if Kube-proxy is in "userspace" mode.
// So we check the kube-proxy mode and skip this test if that's the case.
if
proxyMode
,
err
:=
framework
.
ProxyMode
(
f
);
err
==
nil
{
if
proxyMode
==
"userspace"
{
framework
.
Skipf
(
"The test doesn't work with kube-proxy in userspace mode"
)
}
}
else
{
framework
.
Logf
(
"Couldn't detect KubeProxy mode - test failure may be expected: %v"
,
err
)
}
serviceName
:=
"sourceip-test"
ns
:=
f
.
Namespace
.
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