apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  annotations:
    build.appstudio.redhat.com/bundle: >-
      quay.io/redhat-appstudio-tekton-catalog/pipeline-docker-build:c21fb3956e9ecfc76c293f05501d5437aebe394f
    build.appstudio.redhat.com/pipeline_name: docker-build
    build.appstudio.redhat.com/target_branch: ''
    chains.tekton.dev/signed: 'true'
    pipeline.tekton.dev/release: 1759eab
    results.tekton.dev/record: >-
      loadtestsvzyajzu4092-tenant/results/740c9b27-e0fd-4b33-8008-1fcbd1126f14/records/740c9b27-e0fd-4b33-8008-1fcbd1126f14
    results.tekton.dev/result: loadtestsvzyajzu4092-tenant/results/740c9b27-e0fd-4b33-8008-1fcbd1126f14
  resourceVersion: '17015316'
  name: loadtestsvzyajzu4092-tenant-component-2bmhp-clone-repository
  uid: 4aefb2f0-2e33-4682-a306-61f22613d0b6
  creationTimestamp: '2023-02-08T15:51:59Z'
  generation: 1
  managedFields:
    - apiVersion: tekton.dev/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            .: {}
            'f:build.appstudio.redhat.com/bundle': {}
            'f:build.appstudio.redhat.com/pipeline_name': {}
            'f:build.appstudio.redhat.com/target_branch': {}
            'f:pipeline.tekton.dev/release': {}
            'f:results.tekton.dev/record': {}
            'f:results.tekton.dev/result': {}
          'f:labels':
            'f:tekton.dev/pipelineTask': {}
            'f:pipelines.openshift.io/used-by': {}
            'f:pipelines.appstudio.openshift.io/type': {}
            'f:appstudio.openshift.io/application': {}
            'f:tekton.dev/memberOf': {}
            .: {}
            'f:tekton.dev/pipelineRun': {}
            'f:appstudio.openshift.io/component': {}
            'f:pipelines.openshift.io/strategy': {}
            'f:pipelines.openshift.io/runtime': {}
            'f:tekton.dev/pipeline': {}
          'f:ownerReferences':
            .: {}
            'k:{"uid":"740c9b27-e0fd-4b33-8008-1fcbd1126f14"}': {}
        'f:spec':
          .: {}
          'f:params': {}
          'f:resources': {}
          'f:serviceAccountName': {}
          'f:taskRef':
            .: {}
            'f:bundle': {}
            'f:kind': {}
            'f:name': {}
          'f:timeout': {}
          'f:workspaces': {}
      manager: Go-http-client
      operation: Update
      time: '2023-02-08T15:52:02Z'
    - apiVersion: tekton.dev/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
        'f:status':
          .: {}
          'f:completionTime': {}
          'f:conditions': {}
          'f:podName': {}
          'f:startTime': {}
          'f:taskSpec':
            .: {}
            'f:description': {}
            'f:params': {}
            'f:results': {}
            'f:steps': {}
            'f:workspaces': {}
      manager: Go-http-client
      operation: Update
      subresource: status
      time: '2023-02-08T15:52:02Z'
    - apiVersion: tekton.dev/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            'f:chains.tekton.dev/signed': {}
          'f:finalizers':
            .: {}
            'v:"chains.tekton.dev"': {}
      manager: controller
      operation: Update
      time: '2023-02-08T15:52:03Z'
  namespace: loadtestsvzyajzu4092-tenant
  ownerReferences:
    - apiVersion: tekton.dev/v1beta1
      blockOwnerDeletion: true
      controller: true
      kind: PipelineRun
      name: loadtestsvzyajzu4092-tenant-component-2bmhp
      uid: 740c9b27-e0fd-4b33-8008-1fcbd1126f14
  finalizers:
    - chains.tekton.dev
  labels:
    tekton.dev/memberOf: tasks
    appstudio.openshift.io/component: loadtestsvzyajzu4092-tenant-component
    pipelines.openshift.io/runtime: generic
    pipelines.openshift.io/strategy: docker
    tekton.dev/pipeline: docker-build
    pipelines.openshift.io/used-by: build-cloud
    app.kubernetes.io/managed-by: tekton-pipelines
    appstudio.openshift.io/application: loadtestsvzyajzu4092-tenant-app
    tekton.dev/pipelineTask: clone-repository
    pipelines.appstudio.openshift.io/type: build
    tekton.dev/pipelineRun: loadtestsvzyajzu4092-tenant-component-2bmhp
spec:
  params:
    - name: url
      value: 'https://github.com/sawood14012/simple-nodejs-app'
    - name: revision
      value: ''
  resources: {}
  serviceAccountName: pipeline
  taskRef:
    bundle: >-
      quay.io/redhat-appstudio-tekton-catalog/task-git-clone:0.1@sha256:f4e37778cba00296606ddfbc1c58181330899cafcaa1ee41c75a7cf8bed312f0
    kind: Task
    name: git-clone
  timeout: 54m54.658872745s
  workspaces:
    - name: output
      persistentVolumeClaim:
        claimName: pvc-a9653af537
status:
  completionTime: '2023-02-08T15:52:01Z'
  conditions:
    - lastTransitionTime: '2023-02-08T15:52:01Z'
      message: >-
        failed to create task run pod
        "loadtestsvzyajzu4092-tenant-component-2bmhp-clone-repository": pods
        "loadtestsvzyajzu4092-tenantf06a8a5a9403a768f91036e4ec90159a-pod" is
        forbidden: unable to validate against any security context constraint:
        [provider "anyuid": Forbidden: not usable by user or serviceaccount,
        provider "pipelines-scc": Forbidden: not usable by user or
        serviceaccount, spec.containers[0].securityContext.runAsUser: Invalid
        value: 0: must be in the ranges: [1004190000, 1004199999], provider
        "restricted": Forbidden: not usable by user or serviceaccount, provider
        "nonroot-v2": Forbidden: not usable by user or serviceaccount,
        spec.containers[0].securityContext.runAsUser: Invalid value: 0: running
        with the root UID is forbidden, provider "csi-scc": Forbidden: not
        usable by user or serviceaccount, provider "pcap-dedicated-admins":
        Forbidden: not usable by user or serviceaccount, provider
        "hostmount-anyuid": Forbidden: not usable by user or serviceaccount,
        provider "machine-api-termination-handler": Forbidden: not usable by
        user or serviceaccount, provider "hostnetwork-v2": Forbidden: not usable
        by user or serviceaccount, provider "hostnetwork": Forbidden: not usable
        by user or serviceaccount, provider "hostaccess": Forbidden: not usable
        by user or serviceaccount, provider "splunkforwarder": Forbidden: not
        usable by user or serviceaccount, provider "node-exporter": Forbidden:
        not usable by user or serviceaccount, provider "privileged": Forbidden:
        not usable by user or serviceaccount]. Maybe missing or invalid Task
        loadtestsvzyajzu4092-tenant/git-clone
      reason: CouldntGetTask
      status: 'False'
      type: Succeeded
  podName: ''
  startTime: '2023-02-08T15:51:59Z'
  taskSpec:
    description: >-
      These Tasks are Git tasks to work with repositories used by other tasks in
      your Pipeline.

      The git-clone Task will clone a repo from the provided url into the output
      Workspace. By default the repo will be cloned into the root of your
      Workspace. You can clone into a subdirectory by setting this Task's
      subdirectory param. This Task also supports sparse checkouts. To perform a
      sparse checkout, pass a list of comma separated directory patterns to this
      Task's sparseCheckoutDirectories param.
    params:
      - description: Repository URL to clone from.
        name: url
        type: string
      - default: ''
        description: 'Revision to checkout. (branch, tag, sha, ref, etc...)'
        name: revision
        type: string
      - default: ''
        description: Refspec to fetch before checking out revision.
        name: refspec
        type: string
      - default: 'true'
        description: Initialize and fetch git submodules.
        name: submodules
        type: string
      - default: '1'
        description: 'Perform a shallow clone, fetching only the most recent N commits.'
        name: depth
        type: string
      - default: 'true'
        description: >-
          Set the `http.sslVerify` global git config. Setting this to `false` is
          not advised unless you are sure that you trust your git remote.
        name: sslVerify
        type: string
      - default: ''
        description: Subdirectory inside the `output` Workspace to clone the repo into.
        name: subdirectory
        type: string
      - default: ''
        description: >-
          Define the directory patterns to match or exclude when performing a
          sparse checkout.
        name: sparseCheckoutDirectories
        type: string
      - default: 'true'
        description: >-
          Clean out the contents of the destination directory if it already
          exists before cloning.
        name: deleteExisting
        type: string
      - default: ''
        description: HTTP proxy server for non-SSL requests.
        name: httpProxy
        type: string
      - default: ''
        description: HTTPS proxy server for SSL requests.
        name: httpsProxy
        type: string
      - default: ''
        description: Opt out of proxying HTTP/HTTPS requests.
        name: noProxy
        type: string
      - default: 'true'
        description: Log the commands that are executed during `git-clone`'s operation.
        name: verbose
        type: string
      - default: >-
          registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8:v1.8.2-8@sha256:a538c423e7a11aae6ae582a411fdb090936458075f99af4ce5add038bb6983e8
        description: The image providing the git-init binary that this Task runs.
        name: gitInitImage
        type: string
      - default: /tekton/home
        description: >
          Absolute path to the user's home directory. Set this explicitly if you
          are running the image as a non-root user or have overridden

          the gitInitImage param with an image containing custom user
          configuration.
        name: userHome
        type: string
    results:
      - description: The precise commit SHA that was fetched by this Task.
        name: commit
        type: string
      - description: The precise URL that was fetched by this Task.
        name: url
        type: string
    steps:
      - env:
          - name: HOME
            value: /tekton/home
          - name: PARAM_URL
            value: 'https://github.com/sawood14012/simple-nodejs-app'
          - name: PARAM_REVISION
          - name: PARAM_REFSPEC
          - name: PARAM_SUBMODULES
            value: 'true'
          - name: PARAM_DEPTH
            value: '1'
          - name: PARAM_SSL_VERIFY
            value: 'true'
          - name: PARAM_SUBDIRECTORY
          - name: PARAM_DELETE_EXISTING
            value: 'true'
          - name: PARAM_HTTP_PROXY
          - name: PARAM_HTTPS_PROXY
          - name: PARAM_NO_PROXY
          - name: PARAM_VERBOSE
            value: 'true'
          - name: PARAM_SPARSE_CHECKOUT_DIRECTORIES
          - name: PARAM_USER_HOME
            value: /tekton/home
          - name: WORKSPACE_OUTPUT_PATH
            value: $(workspaces.output.path)
          - name: WORKSPACE_SSH_DIRECTORY_BOUND
            value: $(workspaces.ssh-directory.bound)
          - name: WORKSPACE_SSH_DIRECTORY_PATH
            value: $(workspaces.ssh-directory.path)
          - name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND
            value: $(workspaces.basic-auth.bound)
          - name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH
            value: $(workspaces.basic-auth.path)
        image: >-
          registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8:v1.8.2-8@sha256:a538c423e7a11aae6ae582a411fdb090936458075f99af4ce5add038bb6983e8
        name: clone
        resources: {}
        script: >
          #!/usr/bin/env sh

          set -eu


          if [ "${PARAM_VERBOSE}" = "true" ] ; then
            set -x
          fi


          if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then
            cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" "${PARAM_USER_HOME}/.git-credentials"
            cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" "${PARAM_USER_HOME}/.gitconfig"
            chmod 400 "${PARAM_USER_HOME}/.git-credentials"
            chmod 400 "${PARAM_USER_HOME}/.gitconfig"
          fi


          if [ "${WORKSPACE_SSH_DIRECTORY_BOUND}" = "true" ] ; then
            cp -R "${WORKSPACE_SSH_DIRECTORY_PATH}" "${PARAM_USER_HOME}"/.ssh
            chmod 700 "${PARAM_USER_HOME}"/.ssh
            chmod -R 400 "${PARAM_USER_HOME}"/.ssh/*
          fi


          CHECKOUT_DIR="${WORKSPACE_OUTPUT_PATH}/${PARAM_SUBDIRECTORY}"


          cleandir() {
            # Delete any existing contents of the repo directory if it exists.
            #
            # We don't just "rm -rf ${CHECKOUT_DIR}" because ${CHECKOUT_DIR} might be "/"
            # or the root of a mounted volume.
            if [ -d "${CHECKOUT_DIR}" ] ; then
              # Delete non-hidden files and directories
              rm -rf "${CHECKOUT_DIR:?}"/*
              # Delete files and directories starting with . but excluding ..
              rm -rf "${CHECKOUT_DIR}"/.[!.]*
              # Delete files and directories starting with .. plus any other character
              rm -rf "${CHECKOUT_DIR}"/..?*
            fi
          }


          if [ "${PARAM_DELETE_EXISTING}" = "true" ] ; then
            cleandir
          fi


          test -z "${PARAM_HTTP_PROXY}" || export
          HTTP_PROXY="${PARAM_HTTP_PROXY}"

          test -z "${PARAM_HTTPS_PROXY}" || export
          HTTPS_PROXY="${PARAM_HTTPS_PROXY}"

          test -z "${PARAM_NO_PROXY}" || export NO_PROXY="${PARAM_NO_PROXY}"


          /ko-app/git-init \
            -url="${PARAM_URL}" \
            -revision="${PARAM_REVISION}" \
            -refspec="${PARAM_REFSPEC}" \
            -path="${CHECKOUT_DIR}" \
            -sslVerify="${PARAM_SSL_VERIFY}" \
            -submodules="${PARAM_SUBMODULES}" \
            -depth="${PARAM_DEPTH}" \
            -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}"
          cd "${CHECKOUT_DIR}"

          RESULT_SHA="$(git rev-parse HEAD)"

          EXIT_CODE="$?"

          if [ "${EXIT_CODE}" != 0 ] ; then
            exit "${EXIT_CODE}"
          fi

          printf "%s" "${RESULT_SHA}" > "/tekton/results/commit"

          printf "%s" "${PARAM_URL}" > "/tekton/results/url"
        securityContext:
          runAsUser: 0
    workspaces:
      - description: The git repo will be cloned onto the volume backing this Workspace.
        name: output
      - description: >
          A .ssh directory with private key, known_hosts, config, etc. Copied to

          the user's home before git commands are executed. Used to authenticate

          with the git remote when performing the clone. Binding a Secret to
          this

          Workspace is strongly recommended over other volume types.
        name: ssh-directory
        optional: true
      - description: |
          A Workspace containing a .gitconfig and .git-credentials file. These
          will be copied to the user's home before any git commands are run. Any
          other files in this Workspace are ignored. It is strongly recommended
          to use ssh-directory over basic-auth whenever possible and to bind a
          Secret to this Workspace over other volume types.
        name: basic-auth
        optional: true
