From 17d33a416611c608576d0910bba93fa6041900d9 Mon Sep 17 00:00:00 2001 From: Khurram Baig Date: Wed, 13 Sep 2023 21:10:15 +0530 Subject: [PATCH] Remove results annotations filtering We require some of results annotations at creation time. Fixes https://github.com/tektoncd/pipeline/issues/6857 --- pkg/apis/pipeline/constant.go | 2 +- pkg/apis/pipeline/v1/pipelinerun_defaults_test.go | 2 +- pkg/apis/pipeline/v1/taskrun_defaults_test.go | 2 +- pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go | 2 +- pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go | 2 +- pkg/reconciler/pipelinerun/pipelinerun_test.go | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/apis/pipeline/constant.go b/pkg/apis/pipeline/constant.go index 5fceccbf50b..19604205b84 100644 --- a/pkg/apis/pipeline/constant.go +++ b/pkg/apis/pipeline/constant.go @@ -18,5 +18,5 @@ package pipeline const ( // TektonReservedAnnotationExpr is the expression we use to filter out reserved key in annotation - TektonReservedAnnotationExpr = "(results.tekton.dev|chains.tekton.dev)/.*" + TektonReservedAnnotationExpr = "(chains.tekton.dev)/.*" ) diff --git a/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go b/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go index 4972faf3de1..c7a1878b7c9 100644 --- a/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go +++ b/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go @@ -465,7 +465,7 @@ func TestPipelineRunDefaultingOnCreate(t *testing.T) { }, want: &v1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"tekton.dev/foo": "bar", "foo": "bar"}, + Annotations: map[string]string{"results.tekton.dev/hello": "world", "tekton.dev/foo": "bar", "foo": "bar"}, }, Spec: v1.PipelineRunSpec{ TaskRunTemplate: v1.PipelineTaskRunTemplate{ diff --git a/pkg/apis/pipeline/v1/taskrun_defaults_test.go b/pkg/apis/pipeline/v1/taskrun_defaults_test.go index dbb8ebe84bb..e7f21901ea8 100644 --- a/pkg/apis/pipeline/v1/taskrun_defaults_test.go +++ b/pkg/apis/pipeline/v1/taskrun_defaults_test.go @@ -451,7 +451,7 @@ func TestTaskRunDefaultingOnCreate(t *testing.T) { want: &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{"app.kubernetes.io/managed-by": "tekton-pipelines"}, - Annotations: map[string]string{"tekton.dev/foo": "bar", "foo": "bar"}, + Annotations: map[string]string{"results.tekton.dev/hello": "world", "tekton.dev/foo": "bar", "foo": "bar"}, }, Spec: v1.TaskRunSpec{ TaskRef: &v1.TaskRef{ diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go index d0c9eb576a5..a2853a95bce 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go @@ -420,7 +420,7 @@ func TestPipelineRunDefaultingOnCreate(t *testing.T) { }, want: &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"tekton.dev/foo": "bar", "foo": "bar"}, + Annotations: map[string]string{"results.tekton.dev/hello": "world", "tekton.dev/foo": "bar", "foo": "bar"}, }, Spec: v1beta1.PipelineRunSpec{ ServiceAccountName: config.DefaultServiceAccountValue, diff --git a/pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go b/pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go index 58e421741cf..e560ca1f72a 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go @@ -435,7 +435,7 @@ func TestTaskRunDefaultingOnCreate(t *testing.T) { want: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{"app.kubernetes.io/managed-by": "tekton-pipelines"}, - Annotations: map[string]string{"tekton.dev/foo": "bar", "foo": "bar"}, + Annotations: map[string]string{"results.tekton.dev/hello": "world", "tekton.dev/foo": "bar", "foo": "bar"}, }, Spec: v1beta1.TaskRunSpec{ TaskRef: &v1beta1.TaskRef{ diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index ae302e6fd84..9c7f2b00129 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -12417,7 +12417,6 @@ func TestReconcile_FilterLabels(t *testing.T) { namespace: foo annotations: chains.tekton.dev/signed: "true" - results.tekton.dev/foo: "bar" tekton.dev/foo: "bar" foo: bar spec: