Skip to content

Commit

Permalink
Merge pull request #75622 from jonsabo/ssetresync
Browse files Browse the repository at this point in the history
Remove resync period for sset controller
  • Loading branch information
k8s-ci-robot committed Apr 4, 2019
2 parents f1acf4a + 445d711 commit eee8af9
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions pkg/controller/statefulset/stateful_set.go
Expand Up @@ -44,11 +44,6 @@ import (
"k8s.io/klog"
)

const (
// period to relist statefulsets and verify pets
statefulSetResyncPeriod = 30 * time.Second
)

// controllerKind contains the schema.GroupVersionKind for this controller type.
var controllerKind = apps.SchemeGroupVersion.WithKind("StatefulSet")

Expand Down Expand Up @@ -121,7 +116,7 @@ func NewStatefulSetController(
ssc.podLister = podInformer.Lister()
ssc.podListerSynced = podInformer.Informer().HasSynced

setInformer.Informer().AddEventHandlerWithResyncPeriod(
setInformer.Informer().AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: ssc.enqueueStatefulSet,
UpdateFunc: func(old, cur interface{}) {
Expand All @@ -134,7 +129,6 @@ func NewStatefulSetController(
},
DeleteFunc: ssc.enqueueStatefulSet,
},
statefulSetResyncPeriod,
)
ssc.setLister = setInformer.Lister()
ssc.setListerSynced = setInformer.Informer().HasSynced
Expand Down Expand Up @@ -201,7 +195,7 @@ func (ssc *StatefulSetController) updatePod(old, cur interface{}) {
curPod := cur.(*v1.Pod)
oldPod := old.(*v1.Pod)
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.
return
}
Expand Down Expand Up @@ -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
// 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
// changed labels the new StatefulSet will not be woken up till the periodic resync.
// the deleted key/value. Note that this value might be stale.
if !ok {
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
Expand Down

0 comments on commit eee8af9

Please sign in to comment.