Use PV shared informer in PV controller

This commit is contained in:
Matthew Wong
2016-08-25 21:55:23 -04:00
parent d836b248b2
commit 1d6dbdd9d2
6 changed files with 80 additions and 44 deletions

View File

@@ -153,8 +153,8 @@ const createProvisionedPVInterval = 10 * time.Second
// framework.Controllers that watch PersistentVolume and PersistentVolumeClaim
// changes.
type PersistentVolumeController struct {
volumeController *framework.Controller
volumeSource cache.ListerWatcher
volumeController framework.ControllerInterface
pvInformer framework.SharedIndexInformer
claimController *framework.Controller
claimSource cache.ListerWatcher
classReflector *cache.Reflector
@@ -175,6 +175,13 @@ type PersistentVolumeController struct {
claims cache.Store
classes cache.Store
// isInformerInternal is true if the informer we hold is a personal informer,
// false if it is a shared informer. If we're using a normal shared informer,
// then the informer will be started for us. If we have a personal informer,
// we must start it ourselves. If you start the controller using
// NewPersistentVolumeController(passing SharedInformer), this will be false.
isInformerInternal bool
// Map of scheduled/running operations.
runningOperations goroutinemap.GoRoutineMap