Skip to content

Commit

Permalink
UPSTREAM: 57349: add watch to requirements for quota-able resources
Browse files Browse the repository at this point in the history
:100644 100644 19c8e03a8a... 2d864fd3ab... M	pkg/controller/resourcequota/resource_quota_controller.go
  • Loading branch information
deads2k committed Jan 2, 2018
1 parent 3ed39b9 commit b68cbb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/resourcequota/resource_quota_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func NewResourceQuotaController(options *ResourceQuotaControllerOptions) (*Resou
rq.resyncPeriod(),
)

if options.DiscoveryFunc != nil{
if options.DiscoveryFunc != nil {
qm := &QuotaMonitor{
informersStarted: options.InformersStarted,
informerFactory: options.InformerFactory,
Expand Down Expand Up @@ -277,7 +277,7 @@ func (rq *ResourceQuotaController) Run(workers int, stopCh <-chan struct{}) {
glog.Infof("Starting resource quota controller")
defer glog.Infof("Shutting down resource quota controller")

if rq.quotaMonitor != nil{
if rq.quotaMonitor != nil {
go rq.quotaMonitor.Run(stopCh)
}

Expand Down Expand Up @@ -460,7 +460,7 @@ func (rq *ResourceQuotaController) Sync(discoveryFunc NamespacedResourcesFunc, p
// resyncMonitors starts or stops quota monitors as needed to ensure that all
// (and only) those resources present in the map are monitored.
func (rq *ResourceQuotaController) resyncMonitors(resources map[schema.GroupVersionResource]struct{}) error {
if rq.quotaMonitor == nil{
if rq.quotaMonitor == nil {
return nil
}

Expand All @@ -478,7 +478,7 @@ func GetQuotableResources(discoveryFunc NamespacedResourcesFunc) (map[schema.Gro
if err != nil {
return nil, fmt.Errorf("failed to discover resources: %v", err)
}
quotableResources := discovery.FilteredBy(discovery.SupportsAllVerbs{Verbs: []string{"create", "list", "delete"}}, possibleResources)
quotableResources := discovery.FilteredBy(discovery.SupportsAllVerbs{Verbs: []string{"create", "list", "watch", "delete"}}, possibleResources)
quotableGroupVersionResources, err := discovery.GroupVersionResources(quotableResources)
if err != nil {
return nil, fmt.Errorf("Failed to parse resources: %v", err)
Expand Down

0 comments on commit b68cbb8

Please sign in to comment.