diff --git a/pkg/reconciler/pipelinerun/pipelinespec/pipelinespec.go b/pkg/reconciler/pipelinerun/pipelinespec/pipelinespec.go index fc916b28ec2..ec02d96ae49 100644 --- a/pkg/reconciler/pipelinerun/pipelinespec/pipelinespec.go +++ b/pkg/reconciler/pipelinerun/pipelinespec/pipelinespec.go @@ -44,7 +44,7 @@ func GetPipelineData(ctx context.Context, pipelineRun *v1.PipelineRun, getPipeli // Get related pipeline for pipelinerun p, source, vr, err := getPipeline(ctx, pipelineRun.Spec.PipelineRef.Name) if err != nil { - return nil, nil, fmt.Errorf("error when listing pipelines for pipelineRun %s: %w", pipelineRun.Name, err) + return nil, nil, fmt.Errorf("error when getting Pipeline for PipelineRun %s: %w", pipelineRun.Name, err) } pipelineMeta = p.PipelineMetadata() pipelineSpec = p.PipelineSpec() diff --git a/pkg/reconciler/pipelinerun/resources/pipelineref.go b/pkg/reconciler/pipelinerun/resources/pipelineref.go index 075ab9b5afc..a6674f15483 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelineref.go +++ b/pkg/reconciler/pipelinerun/resources/pipelineref.go @@ -102,7 +102,7 @@ func (l *LocalPipelineRefResolver) GetPipeline(ctx context.Context, name string) pipeline, err := l.Tektonclient.TektonV1().Pipelines(l.Namespace).Get(ctx, name, metav1.GetOptions{}) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, fmt.Errorf("tekton client cannot get pipeline %s from local cluster: %w", name, err) } return pipeline, nil, nil, nil } @@ -115,11 +115,11 @@ func (l *LocalPipelineRefResolver) GetPipeline(ctx context.Context, name string) func resolvePipeline(ctx context.Context, resolver remote.Resolver, name string, namespace string, k8s kubernetes.Interface, tekton clientset.Interface, verificationPolicies []*v1alpha1.VerificationPolicy) (*v1.Pipeline, *v1.RefSource, *trustedresources.VerificationResult, error) { obj, refSource, err := resolver.Get(ctx, "pipeline", name) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, fmt.Errorf("resolver failed to get Pipeline %s: %w", name, err) } pipelineObj, vr, err := readRuntimeObjectAsPipeline(ctx, namespace, obj, k8s, tekton, refSource, verificationPolicies) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, fmt.Errorf("failed to read runtime object as Pipeline: %w", err) } return pipelineObj, refSource, vr, nil } @@ -150,7 +150,7 @@ func readRuntimeObjectAsPipeline(ctx context.Context, namespace string, obj runt }, } if err := obj.ConvertTo(ctx, p); err != nil { - return nil, nil, fmt.Errorf("failed to convert obj %s into Pipeline", obj.GetObjectKind().GroupVersionKind().String()) + return nil, nil, fmt.Errorf("failed to convert v1beta1 obj %s into v1 Pipeline", obj.GetObjectKind().GroupVersionKind().String()) } return p, &vr, nil case *v1.Pipeline: diff --git a/pkg/reconciler/pipelinerun/resources/pipelineref_test.go b/pkg/reconciler/pipelinerun/resources/pipelineref_test.go index cd71aecde58..564a5160996 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelineref_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelineref_test.go @@ -1242,7 +1242,7 @@ func TestGetPipelineFunc_GetFuncError(t *testing.T) { name: "get error when remote resolution return error", requester: requesterUnsigned, pipelinerun: *prResolutionError, - expectedErr: fmt.Errorf("error accessing data from remote resource: %w", resolvedUnsigned.DataErr), + expectedErr: fmt.Errorf("resolver failed to get Pipeline %s: error accessing data from remote resource: %w", prResolutionError.Spec.PipelineRef.Name, resolvedUnsigned.DataErr), }, } for _, tc := range testcases {