From 8bb8347eef1574d4e77b59d52b72df0b453bbc12 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Mon, 15 Jun 2020 12:23:52 +0100 Subject: [PATCH] Cleanup logic for API convertion errors When we used to store v1alpha1, the get pipeline and task data function could return an error related to coverting between API versions. Now that we store v1beta1, that error is not returned anymore by those functions, so we can cleanup the error handling specific to it. --- pkg/reconciler/pipelinerun/pipelinerun.go | 8 -------- pkg/reconciler/taskrun/taskrun.go | 3 --- 2 files changed, 11 deletions(-) diff --git a/pkg/reconciler/pipelinerun/pipelinerun.go b/pkg/reconciler/pipelinerun/pipelinerun.go index a4f06d4adef..0384605f2af 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun.go +++ b/pkg/reconciler/pipelinerun/pipelinerun.go @@ -228,10 +228,6 @@ func (c *Reconciler) updatePipelineResults(ctx context.Context, pr *v1beta1.Pipe } _, pipelineSpec, err := resources.GetPipelineData(ctx, pr, resolver.GetPipeline) if err != nil { - if ce, ok := err.(*v1beta1.CannotConvertError); ok { - pr.Status.MarkResourceNotConvertible(ce) - return - } logger.Errorf("Failed to determine Pipeline spec to use for pipelinerun %s: %v", pr.Name, err) pr.Status.MarkFailed(ReasonCouldntGetPipeline, "Error retrieving pipeline for pipelinerun %s/%s: %s", @@ -255,10 +251,6 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1beta1.PipelineRun) err } pipelineMeta, pipelineSpec, err := resources.GetPipelineData(ctx, pr, resolver.GetPipeline) if err != nil { - if ce, ok := err.(*v1beta1.CannotConvertError); ok { - pr.Status.MarkResourceNotConvertible(ce) - return nil - } logger.Errorf("Failed to determine Pipeline spec to use for pipelinerun %s: %v", pr.Name, err) pr.Status.MarkFailed(ReasonCouldntGetPipeline, "Error retrieving pipeline for pipelinerun %s/%s: %s", diff --git a/pkg/reconciler/taskrun/taskrun.go b/pkg/reconciler/taskrun/taskrun.go index 7e558d05f15..0602cd4f957 100644 --- a/pkg/reconciler/taskrun/taskrun.go +++ b/pkg/reconciler/taskrun/taskrun.go @@ -238,9 +238,6 @@ func (c *Reconciler) prepare(ctx context.Context, tr *v1beta1.TaskRun) (*v1beta1 resolver, kind := c.getTaskResolver(tr) taskMeta, taskSpec, err := resources.GetTaskData(ctx, tr, resolver.GetTask) if err != nil { - if ce, ok := err.(*v1beta1.CannotConvertError); ok { - tr.Status.MarkResourceNotConvertible(ce) - } logger.Errorf("Failed to determine Task spec to use for taskrun %s: %v", tr.Name, err) tr.Status.MarkResourceFailed(podconvert.ReasonFailedResolution, err) return nil, nil, err