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
35bb7825
Commit
35bb7825
authored
May 12, 2017
by
Dan Winship
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove one slightly-broken wait-for-endpoints test util and fix another
parent
b4b5bfdb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
48 deletions
+5
-48
framework.go
test/e2e/framework/framework.go
+0
-47
util.go
test/e2e/framework/util.go
+4
-0
proxy.go
test/e2e/proxy.go
+1
-1
No files found.
test/e2e/framework/framework.go
View file @
35bb7825
...
...
@@ -30,7 +30,6 @@ import (
apierrors
"k8s.io/apimachinery/pkg/api/errors"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/intstr"
...
...
@@ -407,52 +406,6 @@ func (f *Framework) TestContainerOutputRegexp(scenarioName string, pod *v1.Pod,
f
.
testContainerOutputMatcher
(
scenarioName
,
pod
,
containerIndex
,
expectedOutput
,
MatchRegexp
)
}
// WaitForAnEndpoint waits for at least one endpoint to become available in the
// service's corresponding endpoints object.
func
(
f
*
Framework
)
WaitForAnEndpoint
(
serviceName
string
)
error
{
for
{
// TODO: Endpoints client should take a field selector so we
// don't have to list everything.
list
,
err
:=
f
.
ClientSet
.
Core
()
.
Endpoints
(
f
.
Namespace
.
Name
)
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
return
err
}
rv
:=
list
.
ResourceVersion
isOK
:=
func
(
e
*
v1
.
Endpoints
)
bool
{
return
e
.
Name
==
serviceName
&&
len
(
e
.
Subsets
)
>
0
&&
len
(
e
.
Subsets
[
0
]
.
Addresses
)
>
0
}
for
i
:=
range
list
.
Items
{
if
isOK
(
&
list
.
Items
[
i
])
{
return
nil
}
}
options
:=
metav1
.
ListOptions
{
FieldSelector
:
fields
.
Set
{
"metadata.name"
:
serviceName
}
.
AsSelector
()
.
String
(),
ResourceVersion
:
rv
,
}
w
,
err
:=
f
.
ClientSet
.
Core
()
.
Endpoints
(
f
.
Namespace
.
Name
)
.
Watch
(
options
)
if
err
!=
nil
{
return
err
}
defer
w
.
Stop
()
for
{
val
,
ok
:=
<-
w
.
ResultChan
()
if
!
ok
{
// reget and re-watch
break
}
if
e
,
ok
:=
val
.
Object
.
(
*
v1
.
Endpoints
);
ok
{
if
isOK
(
e
)
{
return
nil
}
}
}
}
}
// Write a file using kubectl exec echo <contents> > <path> via specified container
// Because of the primitive technique we're using here, we only allow ASCII alphanumeric characters
func
(
f
*
Framework
)
WriteFileViaContainer
(
podName
,
containerName
string
,
path
string
,
contents
string
)
error
{
...
...
test/e2e/framework/util.go
View file @
35bb7825
...
...
@@ -1569,6 +1569,10 @@ func WaitForReplicationControllerwithSelector(c clientset.Interface, namespace s
func
WaitForEndpoint
(
c
clientset
.
Interface
,
ns
,
name
string
)
error
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
EndpointRegisterTimeout
;
time
.
Sleep
(
Poll
)
{
endpoint
,
err
:=
c
.
Core
()
.
Endpoints
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
apierrs
.
IsNotFound
(
err
)
{
Logf
(
"Endpoint %s/%s is not ready yet"
,
ns
,
name
)
continue
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
if
len
(
endpoint
.
Subsets
)
==
0
||
len
(
endpoint
.
Subsets
[
0
]
.
Addresses
)
==
0
{
Logf
(
"Endpoint %s/%s is not ready yet"
,
ns
,
name
)
...
...
test/e2e/proxy.go
View file @
35bb7825
...
...
@@ -150,7 +150,7 @@ var _ = framework.KubeDescribe("Proxy", func() {
Expect
(
framework
.
RunRC
(
cfg
))
.
NotTo
(
HaveOccurred
())
defer
framework
.
DeleteRCAndPods
(
f
.
ClientSet
,
f
.
InternalClientset
,
f
.
Namespace
.
Name
,
cfg
.
Name
)
Expect
(
f
.
WaitForAnEndpoint
(
service
.
Name
))
.
NotTo
(
HaveOccurred
())
Expect
(
f
ramework
.
WaitForEndpoint
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
service
.
Name
))
.
NotTo
(
HaveOccurred
())
// table constructors
// Try proxying through the service and directly to through the pod.
...
...
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