Skip to content

Commit

Permalink
Query PipelineResources only if needed
Browse files Browse the repository at this point in the history
Change the `tkn pipeline start` command to only query for
PipelineResources in the cluster if the Pipeline uses Resources.
As PipelineResources are marked as deprecated, some cluster maintainers
may decide to not install this CRD altogether.

Signed-off-by: Luiz Carvalho <[email protected]>
  • Loading branch information
lcarva authored and tekton-robot committed Sep 28, 2022
1 parent 7d958cf commit c8dd769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/pipeline/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (opt *startOptions) getInput(pipeline *v1beta1.Pipeline) error {
return err
}

if len(opt.Resources) == 0 && !opt.Last && opt.UsePipelineRun == "" {
if len(pipeline.Spec.Resources) > 0 && len(opt.Resources) == 0 && !opt.Last && opt.UsePipelineRun == "" {
pres, err := getPipelineResources(cs.Resource, opt.cliparams.Namespace())
if err != nil {
return fmt.Errorf("failed to list PipelineResources from namespace %s: %v", opt.cliparams.Namespace(), err)
Expand Down

0 comments on commit c8dd769

Please sign in to comment.