Referencing the Workload Name of a Tanzu Application Workload in a Tekton Task

⚠️ This article was automatically translated by OpenAI (gpt-4o). It may be edited eventually, but please be aware that it may contain incorrect information at this time.

A note on how to reference the Workload name when you want to change the content executed in a script based on the Workload, even though the test script is common.

      steps:
      - name: test
        # ...
        env:
        - name: WORKLOAD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.labels['carto.run/workload-name']
        script: |-
          echo ${WORKLOAD_NAME}
          # ...