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
68b78282
Commit
68b78282
authored
Mar 18, 2017
by
Michail Kargakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
controller: work around milliseconds skew in AddAfter
parent
948e3754
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
daemoncontroller.go
pkg/controller/daemon/daemoncontroller.go
+3
-1
progress.go
pkg/controller/deployment/progress.go
+3
-1
replica_set.go
pkg/controller/replicaset/replica_set.go
+3
-1
replication_controller.go
pkg/controller/replication/replication_controller.go
+3
-1
No files found.
pkg/controller/daemon/daemoncontroller.go
View file @
68b78282
...
@@ -346,7 +346,9 @@ func (dsc *DaemonSetsController) updatePod(old, cur interface{}) {
...
@@ -346,7 +346,9 @@ func (dsc *DaemonSetsController) updatePod(old, cur interface{}) {
dsc
.
enqueueDaemonSet
(
ds
)
dsc
.
enqueueDaemonSet
(
ds
)
// See https://github.com/kubernetes/kubernetes/pull/38076 for more details
// See https://github.com/kubernetes/kubernetes/pull/38076 for more details
if
changedToReady
&&
ds
.
Spec
.
MinReadySeconds
>
0
{
if
changedToReady
&&
ds
.
Spec
.
MinReadySeconds
>
0
{
dsc
.
enqueueDaemonSetAfter
(
ds
,
time
.
Duration
(
ds
.
Spec
.
MinReadySeconds
)
*
time
.
Second
)
// Add a second to avoid milliseconds skew in AddAfter.
// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
dsc
.
enqueueDaemonSetAfter
(
ds
,
(
time
.
Duration
(
ds
.
Spec
.
MinReadySeconds
)
*
time
.
Second
)
+
time
.
Second
)
}
}
return
return
}
}
...
...
pkg/controller/deployment/progress.go
View file @
68b78282
...
@@ -233,6 +233,8 @@ func (dc *DeploymentController) requeueStuckDeployment(d *extensions.Deployment,
...
@@ -233,6 +233,8 @@ func (dc *DeploymentController) requeueStuckDeployment(d *extensions.Deployment,
return
time
.
Duration
(
0
)
return
time
.
Duration
(
0
)
}
}
glog
.
V
(
4
)
.
Infof
(
"Queueing up deployment %q for a progress check after %ds"
,
d
.
Name
,
int
(
after
.
Seconds
()))
glog
.
V
(
4
)
.
Infof
(
"Queueing up deployment %q for a progress check after %ds"
,
d
.
Name
,
int
(
after
.
Seconds
()))
dc
.
enqueueAfter
(
d
,
after
)
// Add a second to avoid milliseconds skew in AddAfter.
// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
dc
.
enqueueAfter
(
d
,
after
+
time
.
Second
)
return
after
return
after
}
}
pkg/controller/replicaset/replica_set.go
View file @
68b78282
...
@@ -320,7 +320,9 @@ func (rsc *ReplicaSetController) updatePod(old, cur interface{}) {
...
@@ -320,7 +320,9 @@ func (rsc *ReplicaSetController) updatePod(old, cur interface{}) {
// "closer" to kubelet (from the deployment to the replica set controller).
// "closer" to kubelet (from the deployment to the replica set controller).
if
!
v1
.
IsPodReady
(
oldPod
)
&&
v1
.
IsPodReady
(
curPod
)
&&
rs
.
Spec
.
MinReadySeconds
>
0
{
if
!
v1
.
IsPodReady
(
oldPod
)
&&
v1
.
IsPodReady
(
curPod
)
&&
rs
.
Spec
.
MinReadySeconds
>
0
{
glog
.
V
(
2
)
.
Infof
(
"ReplicaSet %q will be enqueued after %ds for availability check"
,
rs
.
Name
,
rs
.
Spec
.
MinReadySeconds
)
glog
.
V
(
2
)
.
Infof
(
"ReplicaSet %q will be enqueued after %ds for availability check"
,
rs
.
Name
,
rs
.
Spec
.
MinReadySeconds
)
rsc
.
enqueueReplicaSetAfter
(
rs
,
time
.
Duration
(
rs
.
Spec
.
MinReadySeconds
)
*
time
.
Second
)
// Add a second to avoid milliseconds skew in AddAfter.
// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
rsc
.
enqueueReplicaSetAfter
(
rs
,
(
time
.
Duration
(
rs
.
Spec
.
MinReadySeconds
)
*
time
.
Second
)
+
time
.
Second
)
}
}
return
return
}
}
...
...
pkg/controller/replication/replication_controller.go
View file @
68b78282
...
@@ -319,7 +319,9 @@ func (rm *ReplicationManager) updatePod(old, cur interface{}) {
...
@@ -319,7 +319,9 @@ func (rm *ReplicationManager) updatePod(old, cur interface{}) {
// "closer" to kubelet (from the deployment to the ReplicationController controller).
// "closer" to kubelet (from the deployment to the ReplicationController controller).
if
!
v1
.
IsPodReady
(
oldPod
)
&&
v1
.
IsPodReady
(
curPod
)
&&
rc
.
Spec
.
MinReadySeconds
>
0
{
if
!
v1
.
IsPodReady
(
oldPod
)
&&
v1
.
IsPodReady
(
curPod
)
&&
rc
.
Spec
.
MinReadySeconds
>
0
{
glog
.
V
(
2
)
.
Infof
(
"ReplicationController %q will be enqueued after %ds for availability check"
,
rc
.
Name
,
rc
.
Spec
.
MinReadySeconds
)
glog
.
V
(
2
)
.
Infof
(
"ReplicationController %q will be enqueued after %ds for availability check"
,
rc
.
Name
,
rc
.
Spec
.
MinReadySeconds
)
rm
.
enqueueControllerAfter
(
rc
,
time
.
Duration
(
rc
.
Spec
.
MinReadySeconds
)
*
time
.
Second
)
// Add a second to avoid milliseconds skew in AddAfter.
// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
rm
.
enqueueControllerAfter
(
rc
,
(
time
.
Duration
(
rc
.
Spec
.
MinReadySeconds
)
*
time
.
Second
)
+
time
.
Second
)
}
}
return
return
}
}
...
...
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