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
b267ede4
Commit
b267ede4
authored
Feb 19, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address comments
parent
6ceb221f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
deployment.go
pkg/util/deployment/deployment.go
+1
-4
util.go
test/e2e/util.go
+3
-0
No files found.
pkg/util/deployment/deployment.go
View file @
b267ede4
...
@@ -197,14 +197,11 @@ func getReadyPodsCount(pods []api.Pod, minReadySeconds int) int {
...
@@ -197,14 +197,11 @@ func getReadyPodsCount(pods []api.Pod, minReadySeconds int) int {
}
}
func
IsPodAvailable
(
pod
*
api
.
Pod
,
minReadySeconds
int
)
bool
{
func
IsPodAvailable
(
pod
*
api
.
Pod
,
minReadySeconds
int
)
bool
{
if
!
api
.
IsPodReady
(
pod
)
{
return
false
}
// Check if we've passed minReadySeconds since LastTransitionTime
// Check if we've passed minReadySeconds since LastTransitionTime
// If so, this pod is ready
// If so, this pod is ready
for
_
,
c
:=
range
pod
.
Status
.
Conditions
{
for
_
,
c
:=
range
pod
.
Status
.
Conditions
{
// we only care about pod ready conditions
// we only care about pod ready conditions
if
c
.
Type
==
api
.
PodReady
{
if
c
.
Type
==
api
.
PodReady
&&
c
.
Status
==
api
.
ConditionTrue
{
// 2 cases that this ready condition is valid (passed minReadySeconds, i.e. the pod is ready):
// 2 cases that this ready condition is valid (passed minReadySeconds, i.e. the pod is ready):
// 1. minReadySeconds <= 0
// 1. minReadySeconds <= 0
// 2. LastTransitionTime (is set) + minReadySeconds (>0) < current time
// 2. LastTransitionTime (is set) + minReadySeconds (>0) < current time
...
...
test/e2e/util.go
View file @
b267ede4
...
@@ -2124,6 +2124,7 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d
...
@@ -2124,6 +2124,7 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d
}
}
if
totalCreated
>
maxCreated
{
if
totalCreated
>
maxCreated
{
logReplicaSetsOfDeployment
(
deploymentName
,
oldRSs
,
newRS
)
logReplicaSetsOfDeployment
(
deploymentName
,
oldRSs
,
newRS
)
logPodsOfReplicaSets
(
c
,
allRSs
,
minReadySeconds
)
return
false
,
fmt
.
Errorf
(
"total pods created: %d, more than the max allowed: %d"
,
totalCreated
,
maxCreated
)
return
false
,
fmt
.
Errorf
(
"total pods created: %d, more than the max allowed: %d"
,
totalCreated
,
maxCreated
)
}
}
if
totalAvailable
<
minAvailable
{
if
totalAvailable
<
minAvailable
{
...
@@ -2137,10 +2138,12 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d
...
@@ -2137,10 +2138,12 @@ func waitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, d
// Verify replica sets.
// Verify replica sets.
if
deploymentutil
.
GetReplicaCountForReplicaSets
(
oldRSs
)
!=
0
{
if
deploymentutil
.
GetReplicaCountForReplicaSets
(
oldRSs
)
!=
0
{
logReplicaSetsOfDeployment
(
deploymentName
,
oldRSs
,
newRS
)
logReplicaSetsOfDeployment
(
deploymentName
,
oldRSs
,
newRS
)
logPodsOfReplicaSets
(
c
,
allRSs
,
minReadySeconds
)
return
false
,
fmt
.
Errorf
(
"old replica sets are not fully scaled down"
)
return
false
,
fmt
.
Errorf
(
"old replica sets are not fully scaled down"
)
}
}
if
deploymentutil
.
GetReplicaCountForReplicaSets
([]
*
extensions
.
ReplicaSet
{
newRS
})
!=
desiredUpdatedReplicas
{
if
deploymentutil
.
GetReplicaCountForReplicaSets
([]
*
extensions
.
ReplicaSet
{
newRS
})
!=
desiredUpdatedReplicas
{
logReplicaSetsOfDeployment
(
deploymentName
,
oldRSs
,
newRS
)
logReplicaSetsOfDeployment
(
deploymentName
,
oldRSs
,
newRS
)
logPodsOfReplicaSets
(
c
,
allRSs
,
minReadySeconds
)
return
false
,
fmt
.
Errorf
(
"new replica sets is not fully scaled up"
)
return
false
,
fmt
.
Errorf
(
"new replica sets is not fully scaled up"
)
}
}
return
true
,
nil
return
true
,
nil
...
...
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