apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
  name: clustertask-with-optional-resources-v1beta1
spec:
  params:
  - name: filename
    type: string
    default: "README.md"
  resources:
    inputs:
      - name: git-repo
        type: git
        optional: true
    outputs:
      - name: optionalimage
        type: image
        optional: true
  steps:
    - name: task-echo-success
      image: public.ecr.aws/ubuntu/ubuntu:latest
      script: |
        #!/usr/bin/env bash
        echo "success"
---

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: clustertask-without-resources
spec:
  taskRef:
    name: clustertask-with-optional-resources-v1beta1
    kind: ClusterTask
