fix: use namespace-scoped watching to avoid cluster-wide LIST permissions

Signed-off-by: Mohsen Mottaghi <mohsenmottaghi@outlook.com>
(cherry picked from commit 3dd54ed0b6)
release-4.0
Mohsen Mottaghi 2 months ago committed by Scott Rigby
parent abf2007685
commit 66cab24bb9
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -113,7 +113,9 @@ func (w *statusWaiter) waitForDelete(ctx context.Context, resourceList ResourceL
}
resources = append(resources, obj)
}
eventCh := sw.Watch(cancelCtx, resources, watcher.Options{})
eventCh := sw.Watch(cancelCtx, resources, watcher.Options{
RESTScopeStrategy: watcher.RESTScopeNamespace,
})
statusCollector := collector.NewResourceStatusCollector(resources)
done := statusCollector.ListenWithObserver(eventCh, statusObserver(cancel, status.NotFoundStatus))
<-done
@ -156,7 +158,9 @@ func (w *statusWaiter) wait(ctx context.Context, resourceList ResourceList, sw w
resources = append(resources, obj)
}
eventCh := sw.Watch(cancelCtx, resources, watcher.Options{})
eventCh := sw.Watch(cancelCtx, resources, watcher.Options{
RESTScopeStrategy: watcher.RESTScopeNamespace,
})
statusCollector := collector.NewResourceStatusCollector(resources)
done := statusCollector.ListenWithObserver(eventCh, statusObserver(cancel, status.CurrentStatus))
<-done

Loading…
Cancel
Save