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
222eb31f
Commit
222eb31f
authored
May 06, 2016
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25059 from janetkuo/deployment-availablepods-comment
Fix incorrect comments in IsPodAvailable
parents
d9a4e9b4
f3b1aaec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
deployment.go
pkg/util/deployment/deployment.go
+3
-3
No files found.
pkg/util/deployment/deployment.go
View file @
222eb31f
...
...
@@ -286,11 +286,11 @@ func IsPodAvailable(pod *api.Pod, minReadySeconds int32) bool {
for
_
,
c
:=
range
pod
.
Status
.
Conditions
{
// we only care about pod ready conditions
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
):
// 1. minReadySeconds
<= 0
// 2 cases that this ready condition is valid (passed minReadySeconds, i.e. the pod is
available
):
// 1. minReadySeconds
== 0, or
// 2. LastTransitionTime (is set) + minReadySeconds (>0) < current time
minReadySecondsDuration
:=
time
.
Duration
(
minReadySeconds
)
*
time
.
Second
if
minReadySeconds
<
=
0
||
!
c
.
LastTransitionTime
.
IsZero
()
&&
c
.
LastTransitionTime
.
Add
(
minReadySecondsDuration
)
.
Before
(
time
.
Now
())
{
if
minReadySeconds
=
=
0
||
!
c
.
LastTransitionTime
.
IsZero
()
&&
c
.
LastTransitionTime
.
Add
(
minReadySecondsDuration
)
.
Before
(
time
.
Now
())
{
return
true
}
}
...
...
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