mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
add lastsyncresourceversion to sharedinformer
This commit is contained in:
parent
f3359fe134
commit
3ad54d1812
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user