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
2524cade
Commit
2524cade
authored
May 25, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25171 from bprashanth/rolling
Automatic merge from submit-queue Wait for RC to stabilize in rolling-update e2e
https://github.com/kubernetes/kubernetes/issues/25170
parents
9a996f4e
2d7e2eb0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
util.go
test/e2e/framework/util.go
+30
-0
kubectl.go
test/e2e/kubectl.go
+1
-0
No files found.
test/e2e/framework/util.go
View file @
2524cade
...
@@ -1107,6 +1107,36 @@ func waitForRCPodOnNode(c *client.Client, ns, rcName, node string) (*api.Pod, er
...
@@ -1107,6 +1107,36 @@ func waitForRCPodOnNode(c *client.Client, ns, rcName, node string) (*api.Pod, er
return
p
,
err
return
p
,
err
}
}
// WaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status.
func
WaitForRCToStabilize
(
c
*
client
.
Client
,
ns
,
name
string
,
timeout
time
.
Duration
)
error
{
options
:=
api
.
ListOptions
{
FieldSelector
:
fields
.
Set
{
"metadata.name"
:
name
,
"metadata.namespace"
:
ns
,
}
.
AsSelector
()}
w
,
err
:=
c
.
ReplicationControllers
(
ns
)
.
Watch
(
options
)
if
err
!=
nil
{
return
err
}
_
,
err
=
watch
.
Until
(
timeout
,
w
,
func
(
event
watch
.
Event
)
(
bool
,
error
)
{
switch
event
.
Type
{
case
watch
.
Deleted
:
return
false
,
apierrs
.
NewNotFound
(
unversioned
.
GroupResource
{
Resource
:
"replicationcontrollers"
},
""
)
}
switch
rc
:=
event
.
Object
.
(
type
)
{
case
*
api
.
ReplicationController
:
if
rc
.
Name
==
name
&&
rc
.
Namespace
==
ns
&&
rc
.
Generation
<=
rc
.
Status
.
ObservedGeneration
&&
rc
.
Spec
.
Replicas
==
rc
.
Status
.
Replicas
{
return
true
,
nil
}
Logf
(
"Waiting for rc %s to stabilize, generation %v observed generation %v spec.replicas %d status.replicas %d"
,
name
,
rc
.
Generation
,
rc
.
Status
.
ObservedGeneration
,
rc
.
Spec
.
Replicas
,
rc
.
Status
.
Replicas
)
}
return
false
,
nil
})
return
err
}
func
WaitForPodToDisappear
(
c
*
client
.
Client
,
ns
,
podName
string
,
label
labels
.
Selector
,
interval
,
timeout
time
.
Duration
)
error
{
func
WaitForPodToDisappear
(
c
*
client
.
Client
,
ns
,
podName
string
,
label
labels
.
Selector
,
interval
,
timeout
time
.
Duration
)
error
{
return
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
return
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
Logf
(
"Waiting for pod %s to disappear"
,
podName
)
Logf
(
"Waiting for pod %s to disappear"
,
podName
)
...
...
test/e2e/kubectl.go
View file @
2524cade
...
@@ -904,6 +904,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
...
@@ -904,6 +904,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
nginxImage
{
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
nginxImage
{
framework
.
Failf
(
"Failed creating rc %s for 1 pod with expected image %s"
,
rcName
,
nginxImage
)
framework
.
Failf
(
"Failed creating rc %s for 1 pod with expected image %s"
,
rcName
,
nginxImage
)
}
}
framework
.
WaitForRCToStabilize
(
c
,
ns
,
rcName
,
framework
.
PodStartTimeout
)
By
(
"rolling-update to same image controller"
)
By
(
"rolling-update to same image controller"
)
framework
.
RunKubectlOrDie
(
"rolling-update"
,
rcName
,
"--update-period=1s"
,
"--image="
+
nginxImage
,
"--image-pull-policy="
+
string
(
api
.
PullIfNotPresent
),
nsFlag
)
framework
.
RunKubectlOrDie
(
"rolling-update"
,
rcName
,
"--update-period=1s"
,
"--image="
+
nginxImage
,
"--image-pull-policy="
+
string
(
api
.
PullIfNotPresent
),
nsFlag
)
...
...
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