From 3ad54d1812a7e20f89aef54bf04265cda57a71e9 Mon Sep 17 00:00:00 2001 From: deads2k Date: Tue, 21 Jun 2016 13:13:20 -0400 Subject: [PATCH] add lastsyncresourceversion to sharedinformer --- pkg/controller/framework/shared_informer.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/controller/framework/shared_informer.go b/pkg/controller/framework/shared_informer.go index c557bf97548..8762228ba45 100644 --- a/pkg/controller/framework/shared_informer.go +++ b/pkg/controller/framework/shared_informer.go @@ -44,6 +44,7 @@ type SharedInformer interface { GetController() ControllerInterface Run(stopCh <-chan struct{}) HasSynced() bool + LastSyncResourceVersion() string } type SharedIndexInformer interface { @@ -161,6 +162,16 @@ func (s *sharedIndexInformer) HasSynced() bool { return s.controller.HasSynced() } +func (s *sharedIndexInformer) LastSyncResourceVersion() string { + s.startedLock.Lock() + defer s.startedLock.Unlock() + + if s.controller == nil { + return "" + } + return s.controller.reflector.LastSyncResourceVersion() +} + func (s *sharedIndexInformer) GetStore() cache.Store { return s.indexer }