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
445d7116
Commit
445d7116
authored
Mar 22, 2019
by
Jon Sabo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove resync period
parent
e739b553
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
stateful_set.go
pkg/controller/statefulset/stateful_set.go
+3
-10
No files found.
pkg/controller/statefulset/stateful_set.go
View file @
445d7116
...
@@ -44,11 +44,6 @@ import (
...
@@ -44,11 +44,6 @@ import (
"k8s.io/klog"
"k8s.io/klog"
)
)
const
(
// period to relist statefulsets and verify pets
statefulSetResyncPeriod
=
30
*
time
.
Second
)
// controllerKind contains the schema.GroupVersionKind for this controller type.
// controllerKind contains the schema.GroupVersionKind for this controller type.
var
controllerKind
=
apps
.
SchemeGroupVersion
.
WithKind
(
"StatefulSet"
)
var
controllerKind
=
apps
.
SchemeGroupVersion
.
WithKind
(
"StatefulSet"
)
...
@@ -121,7 +116,7 @@ func NewStatefulSetController(
...
@@ -121,7 +116,7 @@ func NewStatefulSetController(
ssc
.
podLister
=
podInformer
.
Lister
()
ssc
.
podLister
=
podInformer
.
Lister
()
ssc
.
podListerSynced
=
podInformer
.
Informer
()
.
HasSynced
ssc
.
podListerSynced
=
podInformer
.
Informer
()
.
HasSynced
setInformer
.
Informer
()
.
AddEventHandler
WithResyncPeriod
(
setInformer
.
Informer
()
.
AddEventHandler
(
cache
.
ResourceEventHandlerFuncs
{
cache
.
ResourceEventHandlerFuncs
{
AddFunc
:
ssc
.
enqueueStatefulSet
,
AddFunc
:
ssc
.
enqueueStatefulSet
,
UpdateFunc
:
func
(
old
,
cur
interface
{})
{
UpdateFunc
:
func
(
old
,
cur
interface
{})
{
...
@@ -134,7 +129,6 @@ func NewStatefulSetController(
...
@@ -134,7 +129,6 @@ func NewStatefulSetController(
},
},
DeleteFunc
:
ssc
.
enqueueStatefulSet
,
DeleteFunc
:
ssc
.
enqueueStatefulSet
,
},
},
statefulSetResyncPeriod
,
)
)
ssc
.
setLister
=
setInformer
.
Lister
()
ssc
.
setLister
=
setInformer
.
Lister
()
ssc
.
setListerSynced
=
setInformer
.
Informer
()
.
HasSynced
ssc
.
setListerSynced
=
setInformer
.
Informer
()
.
HasSynced
...
@@ -201,7 +195,7 @@ func (ssc *StatefulSetController) updatePod(old, cur interface{}) {
...
@@ -201,7 +195,7 @@ func (ssc *StatefulSetController) updatePod(old, cur interface{}) {
curPod
:=
cur
.
(
*
v1
.
Pod
)
curPod
:=
cur
.
(
*
v1
.
Pod
)
oldPod
:=
old
.
(
*
v1
.
Pod
)
oldPod
:=
old
.
(
*
v1
.
Pod
)
if
curPod
.
ResourceVersion
==
oldPod
.
ResourceVersion
{
if
curPod
.
ResourceVersion
==
oldPod
.
ResourceVersion
{
//
Periodic resync will send
update events for all known pods.
//
In the event of a re-list we may receive
update events for all known pods.
// Two different versions of the same pod will always have different RVs.
// Two different versions of the same pod will always have different RVs.
return
return
}
}
...
@@ -249,8 +243,7 @@ func (ssc *StatefulSetController) deletePod(obj interface{}) {
...
@@ -249,8 +243,7 @@ func (ssc *StatefulSetController) deletePod(obj interface{}) {
// When a delete is dropped, the relist will notice a pod in the store not
// When a delete is dropped, the relist will notice a pod in the store not
// in the list, leading to the insertion of a tombstone object which contains
// in the list, leading to the insertion of a tombstone object which contains
// the deleted key/value. Note that this value might be stale. If the pod
// the deleted key/value. Note that this value might be stale.
// changed labels the new StatefulSet will not be woken up till the periodic resync.
if
!
ok
{
if
!
ok
{
tombstone
,
ok
:=
obj
.
(
cache
.
DeletedFinalStateUnknown
)
tombstone
,
ok
:=
obj
.
(
cache
.
DeletedFinalStateUnknown
)
if
!
ok
{
if
!
ok
{
...
...
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