build controller: use client lister to get builds for policy
@@ -174,6 +174,7 @@ func NewBuildController(params *BuildControllerParams) *BuildController {
buildClient := buildclient.NewOSClientBuildClient(params.OpenshiftClient)
buildLister := params.BuildInformer.Lister()
+ clientBuildLister := buildclient.NewOSClientBuildLister(params.OpenshiftClient)
buildConfigGetter := params.BuildConfigInformer.Lister()
c := &BuildController{
buildPatcher: buildClient,
@@ -200,7 +201,7 @@ func NewBuildController(params *BuildControllerParams) *BuildController {
imageStreamQueue: newResourceTriggerQueue(),
recorder: eventBroadcaster.NewRecorder(kapi.Scheme, clientv1.EventSource{Component: "build-controller"}),
- runPolicies: policy.GetAllRunPolicies(buildLister, buildClient),
+ runPolicies: policy.GetAllRunPolicies(clientBuildLister, buildClient),
}
c.podInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{
