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
5b415a7a
Commit
5b415a7a
authored
Feb 29, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22210 from janetkuo/deployment-e2e
Auto commit by PR queue bot
parents
694cda4a
f129d972
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
60 deletions
+60
-60
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+1
-1
resize_nodes.go
test/e2e/resize_nodes.go
+0
-59
util.go
test/e2e/util.go
+59
-0
No files found.
pkg/controller/deployment/deployment_controller.go
View file @
5b415a7a
...
@@ -743,7 +743,7 @@ func setNewReplicaSetAnnotations(deployment *extensions.Deployment, rs *extensio
...
@@ -743,7 +743,7 @@ func setNewReplicaSetAnnotations(deployment *extensions.Deployment, rs *extensio
if
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
!=
newRevision
{
if
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
!=
newRevision
{
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
=
newRevision
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
=
newRevision
annotationChanged
=
true
annotationChanged
=
true
glog
.
V
(
4
)
.
Infof
(
"updating replica set %q's revision to %s - %+v
\n
"
,
rs
.
Name
,
newRevision
)
glog
.
V
(
4
)
.
Infof
(
"updating replica set %q's revision to %s - %+v
\n
"
,
rs
.
Name
,
newRevision
,
rs
)
}
}
return
annotationChanged
return
annotationChanged
}
}
...
...
test/e2e/resize_nodes.go
View file @
5b415a7a
...
@@ -239,65 +239,6 @@ func resizeRC(c *client.Client, ns, name string, replicas int) error {
...
@@ -239,65 +239,6 @@ func resizeRC(c *client.Client, ns, name string, replicas int) error {
return
err
return
err
}
}
func
podsCreated
(
c
*
client
.
Client
,
ns
,
name
string
,
replicas
int
)
(
*
api
.
PodList
,
error
)
{
timeout
:=
2
*
time
.
Minute
// List the pods, making sure we observe all the replicas.
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"name"
:
name
}))
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
5
*
time
.
Second
)
{
options
:=
api
.
ListOptions
{
LabelSelector
:
label
}
pods
,
err
:=
c
.
Pods
(
ns
)
.
List
(
options
)
if
err
!=
nil
{
return
nil
,
err
}
created
:=
[]
api
.
Pod
{}
for
_
,
pod
:=
range
pods
.
Items
{
if
pod
.
DeletionTimestamp
!=
nil
{
continue
}
created
=
append
(
created
,
pod
)
}
Logf
(
"Pod name %s: Found %d pods out of %d"
,
name
,
len
(
created
),
replicas
)
if
len
(
created
)
==
replicas
{
pods
.
Items
=
created
return
pods
,
nil
}
}
return
nil
,
fmt
.
Errorf
(
"Pod name %s: Gave up waiting %v for %d pods to come up"
,
name
,
timeout
,
replicas
)
}
func
podsRunning
(
c
*
client
.
Client
,
pods
*
api
.
PodList
)
[]
error
{
// Wait for the pods to enter the running state. Waiting loops until the pods
// are running so non-running pods cause a timeout for this test.
By
(
"ensuring each pod is running"
)
e
:=
[]
error
{}
for
_
,
pod
:=
range
pods
.
Items
{
// TODO: make waiting parallel.
err
:=
waitForPodRunningInNamespace
(
c
,
pod
.
Name
,
pod
.
Namespace
)
if
err
!=
nil
{
e
=
append
(
e
,
err
)
}
}
return
e
}
func
verifyPods
(
c
*
client
.
Client
,
ns
,
name
string
,
wantName
bool
,
replicas
int
)
error
{
pods
,
err
:=
podsCreated
(
c
,
ns
,
name
,
replicas
)
if
err
!=
nil
{
return
err
}
e
:=
podsRunning
(
c
,
pods
)
if
len
(
e
)
>
0
{
return
fmt
.
Errorf
(
"failed to wait for pods running: %v"
,
e
)
}
err
=
podsResponding
(
c
,
ns
,
name
,
wantName
,
pods
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to wait for pods responding: %v"
,
err
)
}
return
nil
}
func
getMaster
(
c
*
client
.
Client
)
string
{
func
getMaster
(
c
*
client
.
Client
)
string
{
master
:=
""
master
:=
""
switch
testContext
.
Provider
{
switch
testContext
.
Provider
{
...
...
test/e2e/util.go
View file @
5b415a7a
...
@@ -1159,6 +1159,65 @@ func podsResponding(c *client.Client, ns, name string, wantName bool, pods *api.
...
@@ -1159,6 +1159,65 @@ func podsResponding(c *client.Client, ns, name string, wantName bool, pods *api.
return
wait
.
PollImmediate
(
poll
,
podRespondingTimeout
,
podProxyResponseChecker
{
c
,
ns
,
label
,
name
,
wantName
,
pods
}
.
checkAllResponses
)
return
wait
.
PollImmediate
(
poll
,
podRespondingTimeout
,
podProxyResponseChecker
{
c
,
ns
,
label
,
name
,
wantName
,
pods
}
.
checkAllResponses
)
}
}
func
podsCreated
(
c
*
client
.
Client
,
ns
,
name
string
,
replicas
int
)
(
*
api
.
PodList
,
error
)
{
timeout
:=
2
*
time
.
Minute
// List the pods, making sure we observe all the replicas.
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"name"
:
name
}))
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
timeout
;
time
.
Sleep
(
5
*
time
.
Second
)
{
options
:=
api
.
ListOptions
{
LabelSelector
:
label
}
pods
,
err
:=
c
.
Pods
(
ns
)
.
List
(
options
)
if
err
!=
nil
{
return
nil
,
err
}
created
:=
[]
api
.
Pod
{}
for
_
,
pod
:=
range
pods
.
Items
{
if
pod
.
DeletionTimestamp
!=
nil
{
continue
}
created
=
append
(
created
,
pod
)
}
Logf
(
"Pod name %s: Found %d pods out of %d"
,
name
,
len
(
created
),
replicas
)
if
len
(
created
)
==
replicas
{
pods
.
Items
=
created
return
pods
,
nil
}
}
return
nil
,
fmt
.
Errorf
(
"Pod name %s: Gave up waiting %v for %d pods to come up"
,
name
,
timeout
,
replicas
)
}
func
podsRunning
(
c
*
client
.
Client
,
pods
*
api
.
PodList
)
[]
error
{
// Wait for the pods to enter the running state. Waiting loops until the pods
// are running so non-running pods cause a timeout for this test.
By
(
"ensuring each pod is running"
)
e
:=
[]
error
{}
for
_
,
pod
:=
range
pods
.
Items
{
// TODO: make waiting parallel.
err
:=
waitForPodRunningInNamespace
(
c
,
pod
.
Name
,
pod
.
Namespace
)
if
err
!=
nil
{
e
=
append
(
e
,
err
)
}
}
return
e
}
func
verifyPods
(
c
*
client
.
Client
,
ns
,
name
string
,
wantName
bool
,
replicas
int
)
error
{
pods
,
err
:=
podsCreated
(
c
,
ns
,
name
,
replicas
)
if
err
!=
nil
{
return
err
}
e
:=
podsRunning
(
c
,
pods
)
if
len
(
e
)
>
0
{
return
fmt
.
Errorf
(
"failed to wait for pods running: %v"
,
e
)
}
err
=
podsResponding
(
c
,
ns
,
name
,
wantName
,
pods
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to wait for pods responding: %v"
,
err
)
}
return
nil
}
func
serviceResponding
(
c
*
client
.
Client
,
ns
,
name
string
)
error
{
func
serviceResponding
(
c
*
client
.
Client
,
ns
,
name
string
)
error
{
By
(
fmt
.
Sprintf
(
"trying to dial the service %s.%s via the proxy"
,
ns
,
name
))
By
(
fmt
.
Sprintf
(
"trying to dial the service %s.%s via the proxy"
,
ns
,
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