@@ -403,6 +403,7 @@ func TestReconcile(t *testing.T) {
403403 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
404404 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-success" ),
405405 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "unit-test-1" ),
406+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
406407 tb .TaskRunSpec (
407408 tb .TaskRunTaskRef ("unit-test-task" ),
408409 tb .TaskRunServiceAccountName ("test-sa" ),
@@ -515,6 +516,7 @@ func TestReconcile_CustomTask(t *testing.T) {
515516 "tekton.dev/pipeline" : pipelineRunName ,
516517 "tekton.dev/pipelineRun" : pipelineRunName ,
517518 "tekton.dev/pipelineTask" : pipelineTaskName ,
519+ "tekton.dev/memberOf" : "tasks" ,
518520 },
519521 Annotations : map [string ]string {},
520522 },
@@ -574,6 +576,7 @@ func TestReconcile_CustomTask(t *testing.T) {
574576 "tekton.dev/pipeline" : pipelineRunName ,
575577 "tekton.dev/pipelineRun" : pipelineRunName ,
576578 "tekton.dev/pipelineTask" : pipelineTaskName ,
579+ "tekton.dev/memberOf" : "tasks" ,
577580 },
578581 Annotations : map [string ]string {},
579582 },
@@ -643,6 +646,7 @@ func TestReconcile_CustomTask(t *testing.T) {
643646 "tekton.dev/pipeline" : pipelineRunName ,
644647 "tekton.dev/pipelineRun" : pipelineRunName ,
645648 "tekton.dev/pipelineTask" : pipelineTaskName ,
649+ "tekton.dev/memberOf" : "tasks" ,
646650 },
647651 Annotations : map [string ]string {
648652 "pipeline.tekton.dev/affinity-assistant" : getAffinityAssistantName ("pipelinews" , pipelineRunName ),
@@ -774,6 +778,7 @@ func TestReconcile_PipelineSpecTaskSpec(t *testing.T) {
774778 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
775779 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-success" ),
776780 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "unit-test-task-spec" ),
781+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
777782 tb .TaskRunSpec (tb .TaskRunTaskSpec (tb .Step ("myimage" , tb .StepName ("mystep" ))),
778783 tb .TaskRunServiceAccountName (config .DefaultServiceAccountValue )),
779784 )
@@ -2458,6 +2463,7 @@ func TestReconcilePropagateLabels(t *testing.T) {
24582463 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "hello-world-1" ),
24592464 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-with-labels" ),
24602465 tb .TaskRunLabel ("PipelineRunLabel" , "PipelineRunValue" ),
2466+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
24612467 tb .TaskRunSpec (
24622468 tb .TaskRunTaskRef ("hello-world" ),
24632469 tb .TaskRunServiceAccountName ("test-sa" ),
@@ -2528,6 +2534,7 @@ func TestReconcileWithDifferentServiceAccounts(t *testing.T) {
25282534 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
25292535 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-different-service-accs" ),
25302536 tb .TaskRunLabel ("tekton.dev/pipelineTask" , "hello-world-0" ),
2537+ tb .TaskRunLabel ("tekton.dev/memberOf" , "tasks" ),
25312538 ),
25322539 tb .TaskRun (taskRunNames [1 ],
25332540 tb .TaskRunNamespace ("foo" ),
@@ -2542,6 +2549,7 @@ func TestReconcileWithDifferentServiceAccounts(t *testing.T) {
25422549 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
25432550 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-different-service-accs" ),
25442551 tb .TaskRunLabel ("tekton.dev/pipelineTask" , "hello-world-1" ),
2552+ tb .TaskRunLabel ("tekton.dev/memberOf" , "tasks" ),
25452553 ),
25462554 }
25472555 for i := range ps [0 ].Spec .Tasks {
@@ -2739,6 +2747,7 @@ func TestReconcilePropagateAnnotations(t *testing.T) {
27392747 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
27402748 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "hello-world-1" ),
27412749 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-with-annotations" ),
2750+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
27422751 tb .TaskRunAnnotation ("PipelineRunAnnotation" , "PipelineRunValue" ),
27432752 tb .TaskRunSpec (
27442753 tb .TaskRunTaskRef ("hello-world" ),
@@ -3002,6 +3011,7 @@ func TestReconcileAndPropagateCustomPipelineTaskRunSpec(t *testing.T) {
30023011 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineLabelKey , "test-pipeline" ),
30033012 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "hello-world-1" ),
30043013 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineRunLabelKey , "test-pipeline-run" ),
3014+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
30053015 tb .TaskRunAnnotation ("PipelineRunAnnotation" , "PipelineRunValue" ),
30063016 tb .TaskRunSpec (
30073017 tb .TaskRunTaskRef ("hello-world" ),
@@ -3212,6 +3222,7 @@ func TestReconcileWithFailingConditionChecks(t *testing.T) {
32123222 tb .TaskRunOwnerReference ("kind" , "name" ),
32133223 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineLabelKey , "test-pipeline-run-with-conditions" ),
32143224 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineRunLabelKey , "test-pipeline" ),
3225+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
32153226 tb .TaskRunSpec (tb .TaskRunTaskRef ("hello-world" )),
32163227 tb .TaskRunStatus (tb .StatusCondition (apis.Condition {
32173228 Type : apis .ConditionSucceeded ,
@@ -3267,6 +3278,7 @@ func TestReconcileWithFailingConditionChecks(t *testing.T) {
32673278 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineLabelKey , "test-pipeline" ),
32683279 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "task-3" ),
32693280 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineRunLabelKey , "test-pipeline-run-with-conditions" ),
3281+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
32703282 tb .TaskRunAnnotation ("PipelineRunAnnotation" , "PipelineRunValue" ),
32713283 tb .TaskRunSpec (
32723284 tb .TaskRunTaskRef ("hello-world" ),
@@ -3289,6 +3301,7 @@ func makeExpectedTr(condName, ccName string, labels, annotations map[string]stri
32893301 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineLabelKey , "test-pipeline" ),
32903302 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "hello-world-1" ),
32913303 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineRunLabelKey , "test-pipeline-run" ),
3304+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
32923305 tb .TaskRunLabel (pipeline .GroupName + pipeline .ConditionCheckKey , ccName ),
32933306 tb .TaskRunLabel (pipeline .GroupName + pipeline .ConditionNameKey , condName ),
32943307 tb .TaskRunLabels (labels ),
@@ -3378,6 +3391,7 @@ func TestReconcileWithWhenExpressionsWithParameters(t *testing.T) {
33783391 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineLabelKey , "test-pipeline" ),
33793392 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , "hello-world-1" ),
33803393 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineRunLabelKey , "test-pipeline-run" ),
3394+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
33813395 tb .TaskRunAnnotation ("PipelineRunAnnotation" , "PipelineRunValue" ),
33823396 tb .TaskRunSpec (
33833397 tb .TaskRunTaskRef ("hello-world-1" ),
@@ -3507,6 +3521,7 @@ func TestReconcileWithWhenExpressionsWithTaskResults(t *testing.T) {
35073521 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
35083522 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-different-service-accs" ),
35093523 tb .TaskRunLabel ("tekton.dev/pipelineTask" , "b-task" ),
3524+ tb .TaskRunLabel ("tekton.dev/memberOf" , "tasks" ),
35103525 tb .TaskRunSpec (
35113526 tb .TaskRunTaskRef ("b-task" ),
35123527 tb .TaskRunServiceAccountName ("test-sa-0" ),
@@ -3921,6 +3936,7 @@ func TestReconcileWithTaskResults(t *testing.T) {
39213936 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline" ),
39223937 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-different-service-accs" ),
39233938 tb .TaskRunLabel ("tekton.dev/pipelineTask" , "b-task" ),
3939+ tb .TaskRunLabel ("tekton.dev/memberOf" , "tasks" ),
39243940 tb .TaskRunSpec (
39253941 tb .TaskRunTaskRef ("b-task" ),
39263942 tb .TaskRunServiceAccountName ("test-sa-0" ),
@@ -3997,6 +4013,7 @@ func TestReconcileWithTaskResultsEmbeddedNoneStarted(t *testing.T) {
39974013 tb .TaskRunLabel ("tekton.dev/pipeline" , "test-pipeline-run-different-service-accs" ),
39984014 tb .TaskRunLabel ("tekton.dev/pipelineRun" , "test-pipeline-run-different-service-accs" ),
39994015 tb .TaskRunLabel ("tekton.dev/pipelineTask" , "a-task" ),
4016+ tb .TaskRunLabel ("tekton.dev/memberOf" , "tasks" ),
40004017 tb .TaskRunSpec (
40014018 tb .TaskRunTaskRef ("a-task" , tb .TaskRefKind (v1beta1 .NamespacedTaskKind )),
40024019 tb .TaskRunServiceAccountName ("test-sa-0" ),
@@ -5534,6 +5551,7 @@ func TestReconciler_ReconcileKind_PipelineTaskContext(t *testing.T) {
55345551 tb .TaskRunLabel ("tekton.dev/pipeline" , pipelineName ),
55355552 tb .TaskRunLabel ("tekton.dev/pipelineRun" , pipelineRunName ),
55365553 tb .TaskRunLabel ("tekton.dev/pipelineTask" , "finaltask" ),
5554+ tb .TaskRunLabel ("tekton.dev/memberOf" , "finally" ),
55375555 tb .TaskRunSpec (
55385556 tb .TaskRunTaskRef ("finaltask" ),
55395557 tb .TaskRunServiceAccountName ("test-sa" ),
@@ -5767,6 +5785,7 @@ func TestReconcileWithTaskResultsInFinalTasks(t *testing.T) {
57675785 "tekton.dev/pipeline" : "test-pipeline" ,
57685786 "tekton.dev/pipelineRun" : "test-pipeline-run-final-task-results" ,
57695787 "tekton.dev/pipelineTask" : "final-task-1" ,
5788+ "tekton.dev/memberOf" : "finally" ,
57705789 },
57715790 Annotations : map [string ]string {},
57725791 },
@@ -5953,6 +5972,7 @@ func TestReconcile_RemotePipelineRef(t *testing.T) {
59535972 "tekton.dev/pipeline" : "test-pipeline" ,
59545973 "tekton.dev/pipelineRun" : "test-pipeline-run-success" ,
59555974 pipeline .GroupName + pipeline .PipelineTaskLabelKey : "unit-test-1" ,
5975+ "tekton.dev/memberOf" : "tasks" ,
59565976 },
59575977 OwnerReferences : []metav1.OwnerReference {{
59585978 APIVersion : "tekton.dev/v1beta1" ,
@@ -6060,6 +6080,7 @@ func TestReconcile_OptionalWorkspacesOmitted(t *testing.T) {
60606080 "tekton.dev/pipeline" : "test-pipeline-run-success" ,
60616081 "tekton.dev/pipelineRun" : "test-pipeline-run-success" ,
60626082 pipeline .GroupName + pipeline .PipelineTaskLabelKey : "unit-test-1" ,
6083+ "tekton.dev/memberOf" : "tasks" ,
60636084 },
60646085 OwnerReferences : []metav1.OwnerReference {{
60656086 APIVersion : "tekton.dev/v1beta1" ,
@@ -6263,6 +6284,7 @@ func getTaskRunWithTaskSpec(tr, pr, p, t string, labels, annotations map[string]
62636284 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineLabelKey , p ),
62646285 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineRunLabelKey , pr ),
62656286 tb .TaskRunLabel (pipeline .GroupName + pipeline .PipelineTaskLabelKey , t ),
6287+ tb .TaskRunLabel (pipeline .GroupName + pipeline .MemberOfLabelKey , "tasks" ),
62666288 tb .TaskRunLabels (labels ),
62676289 tb .TaskRunAnnotations (annotations ),
62686290 tb .TaskRunSpec (tb .TaskRunTaskSpec (tb .Step ("myimage" , tb .StepName ("mystep" ))),
0 commit comments