# auto generated by script/update-tasks.sh
# DO NOT EDIT: use the script instead
# source: https://raw.githubusercontent.com/openshift/tektoncd-catalog/release-v0.24/task/tkn/0.2/tkn.yaml
#
---
---
apiVersion: tekton.dev/v1beta1
kind: ClusterTask
metadata:
  name: tkn-1-5-0
  labels:
    app.kubernetes.io/version: "0.2"
  annotations:
    tekton.dev/pipelines.minVersion: "0.17.0"
    tekton.dev/tags: cli
    tekton.dev/displayName: "Tekton CLI"
spec:
  workspaces:
    - name: kubeconfig
      description: >-
        An optional workspace that allows you to provide a .kube/config
        file for tkn to access the cluster. The file should be placed at
        the root of the Workspace with name kubeconfig.
      optional: true
  description: >-
    This task performs operations on Tekton resources using tkn

  params:
    - name: TKN_IMAGE
      description: tkn CLI container image to run this task
      default: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677
    - name: SCRIPT
      description: tkn CLI script to execute
      type: string
      default: "tkn $@"
    - name: ARGS
      type: array
      description: tkn CLI arguments to run
      default: ["--help"]
  steps:
    - name: tkn
      image: "$(params.TKN_IMAGE)"
      script: |
        if [ "$(workspaces.kubeconfig.bound)" == "true" ] && [[ -e $(workspaces.kubeconfig.path)/kubeconfig ]]; then
          export KUBECONFIG=$(workspaces.kubeconfig.path)/kubeconfig
        fi

        $(params.SCRIPT)
      args: ["$(params.ARGS)"]
