diff --git a/pkg/reconciler/pipelinerun/pipelinerun.go b/pkg/reconciler/pipelinerun/pipelinerun.go index 31246a9b43d..b08cbf5279b 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun.go +++ b/pkg/reconciler/pipelinerun/pipelinerun.go @@ -943,9 +943,9 @@ func propagatePipelineNameLabelToPipelineRun(pr *v1beta1.PipelineRun) error { } switch { case pr.Spec.PipelineRef != nil && pr.Spec.PipelineRef.Name != "": - pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = pr.Spec.PipelineRef.Name + pr.ObjectMeta.Labels[pipeline.GroupName+pipeline.PipelineLabelKey] = pr.Spec.PipelineRef.Name case pr.Spec.PipelineSpec != nil: - pr.ObjectMeta.Labels[pipeline.PipelineLabelKey] = pr.Name + pr.ObjectMeta.Labels[pipeline.GroupName+pipeline.PipelineLabelKey] = pr.Name default: return fmt.Errorf("pipelineRun %s not providing PipelineRef or PipelineSpec", pr.Name) } diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index 295bdd9a9cf..06b2ea4feab 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -2586,7 +2586,7 @@ func TestReconcileCancelledFailsTaskRunCancellation(t *testing.T) { t.Fatalf("Somehow had error getting reconciled run out of fake client: %s", err) } - if val, ok := reconciledRun.GetLabels()[pipeline.PipelineLabelKey]; !ok { + if val, ok := reconciledRun.GetLabels()[pipeline.GroupName+pipeline.PipelineLabelKey]; !ok { t.Fatalf("expected pipeline label") if d := cmp.Diff("test-pipelines", val); d != "" { t.Errorf("expected to see pipeline label. Diff %s", diff.PrintWantGot(d))