From 3294a761198622fbebcd4d2bdf0c370b824e5a95 Mon Sep 17 00:00:00 2001 From: Christie Wilson Date: Tue, 22 Jan 2019 17:53:34 -0800 Subject: [PATCH] Remove check for `providedBy` on output Before #320, `providedBy` would be declared on "resources" in general, and so it was possible that this could be declared on an output. Now the schema will only allow `providedBy` to be declared on inputs and so it is no longer possible to get into this position. --- .../v1alpha1/pipelinerun/resources/pipelinerunresolution.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/reconciler/v1alpha1/pipelinerun/resources/pipelinerunresolution.go b/pkg/reconciler/v1alpha1/pipelinerun/resources/pipelinerunresolution.go index af506d968b9..b4ab65fb2b2 100644 --- a/pkg/reconciler/v1alpha1/pipelinerun/resources/pipelinerunresolution.go +++ b/pkg/reconciler/v1alpha1/pipelinerun/resources/pipelinerunresolution.go @@ -271,11 +271,7 @@ func ValidateProvidedBy(state []*ResolvedPipelineRunTask) error { for _, rprt := range state { if rprt.PipelineTask.Resources != nil { for _, dep := range rprt.PipelineTask.Resources.Inputs { - inputBinding, ok := rprt.ResolvedTaskResources.Inputs[dep.Name] - if !ok { - return fmt.Errorf("PipelineTask %s is trying to declare dependency for Resource %s which is not an input of PipelineTask %q", rprt.PipelineTask.Name, dep.Name, rprt.PipelineTask.Name) - } - + inputBinding := rprt.ResolvedTaskResources.Inputs[dep.Name] for _, pb := range dep.ProvidedBy { if pb == rprt.PipelineTask.Name { return fmt.Errorf("PipelineTask %s is trying to depend on a PipelineResource from itself", pb)