apiVersion: tekton.dev/v1alpha1
kind: ClusterTask
metadata:
  name: clustertask-with-optional-resources-v1alpha1
spec:
  inputs:
    resources:
      - name: git-repo
        type: git
        optional: true
    params:
      - name: filename
        type: string
        default: "README.md"
  outputs:
    resources:
      - 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/v1alpha1
kind: TaskRun
metadata:
  name: clustertask-without-resources
spec:
  taskRef:
    name: clustertask-with-optional-resources-v1alpha1
    kind: ClusterTask
