Merge pull request #30825 from wongma7/pv-controller-informer

Automatic merge from submit-queue

Use PV shared informer in PV controller

Use the PV shared informer, addressing (partially) https://github.com/kubernetes/kubernetes/issues/26247 . Using the PVC shared informer is not so simple because sometimes the controller wants to `Requeue` and...
This commit is contained in:
Kubernetes Submit Queue
2016-09-10 12:40:30 -07:00
committed by GitHub
6 changed files with 80 additions and 44 deletions

View File

@@ -154,8 +154,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
@@ -176,6 +176,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