Skip to content

Commit 34ac9b0

Browse files
Merge pull request redhat-appstudio#818 from stuartwdouglas/fix-selector-issue
Fix label selector issue
2 parents d65a20d + d80a18a commit 34ac9b0

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

pkg/controller/controller.go

+3-10
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,16 @@ func NewManager(cfg *rest.Config, options ctrl.Options, quayClient *quay.QuayCli
9595
&appsv1.Deployment{},
9696
}
9797

98-
//we only want to watch the runs we create
99-
ourPipelines := labels.NewSelector()
100-
requirement, lerr := labels.NewRequirement(artifactbuild.PipelineRunLabel, selection.Exists, []string{})
101-
if lerr != nil {
102-
return nil, lerr
103-
}
104-
ourPipelines.Add(*requirement)
105-
//we only want to watch the runs we create
98+
//we only want to watch our cache pods
10699
cachePods := labels.NewSelector()
107100
cacheRequirement, lerr := labels.NewRequirement("app", selection.Equals, []string{v1alpha1.CacheDeploymentName})
108101
if lerr != nil {
109102
return nil, lerr
110103
}
111-
cachePods.Add(*cacheRequirement)
104+
cachePods = cachePods.Add(*cacheRequirement)
112105
options.NewCache = cache.BuilderWithOptions(cache.Options{
113106
SelectorsByObject: cache.SelectorsByObject{
114-
&pipelinev1beta1.PipelineRun{}: {Label: ourPipelines},
107+
&pipelinev1beta1.PipelineRun{}: {},
115108
&v1alpha1.DependencyBuild{}: {},
116109
&v1alpha1.ArtifactBuild{}: {},
117110
&v1alpha1.RebuiltArtifact{}: {},

0 commit comments

Comments
 (0)