---
title: Referencing the Workload Name of a Tanzu Application Workload in a Tekton Task
tags: ["Kubernetes", "Tanzu", "TAP", "Tekton", "Cartographer"]
categories: ["Dev", "CaaS", "Kubernetes", "TAP"]
date: 2024-05-13T04:19:15Z
updated: 2024-05-13T04:19:15Z
---

> ⚠️ 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.

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