Harness enables you to provide metadata for organizing, searching, and filtering components. You add your metadata using Harness Tags. This topic explains how to create Tags, including guidelines and restrictions.
Here's a quick video demo of the process of creating and applying Tags in Harness.
Review: Tag Guidelines
Harness Tags function like the tags on common cloud providers' platforms. They are arbitrary key-value pairs that you can apply to Harness Applications and Application components. As metadata, they facilitate organizing, searching, and filtering on these Harness entities.
Using Tags, you can overlay your organization’s structure onto Harness resources. Here are some sample use cases:
Categorizing Applications and components by team.
Marking Applications and components for reuse, preservation, or deletion.
Allocating costs.
Some examples of Tag keys, with representative values, are:
org: engineering
owner: jenny
validUntil: 1557444441
do-not-delete
The final Tag example above is a key with no value. If assigned to a component, such a Tag with no value simply acts like a flag.
Tag Format Restrictions
Tag names and values are restricted to the following format:
^[/A-Za-z0-9 _-]+
If you are adding Tags in Workflows and Pipelines, you can use variable expressions in the names and values. Variable expressions follow the format ${<variable_name>}.
When the variable expression is evaluated by Harness, it does not need to meet the standard Tag format restrictions. It has no restrictions.
If a Tag uses a variable expression in its name or value, you cannot edit it in Tags Management. You must edit the Tag in a Workflow or Pipeline.
To add a Tag to an Application or supported Application component:
Click into the Application or component to display its Overview card: Application Overview, Environment Overview, Workflow Overview, etc. Here, you can locate and click the Add Tag link:
In the resulting pop-up, select a key from the Tag Name drop-down:
The Tag Value field can normally be left empty, or can accept a single free-form value (subject to Harness' restrictions on Tag values):However, if the tag has Allowed Values—indicated by a R(estricted) symbol—you must select a value from the drop-down list, as shown below:
Click Submit to add your Tag:Each applied Tag's key and value will now appear on the Application's or component's Overview card:
Option 1: Replace Tag Values
If you click Add Tag, and then select a Tag Name that has already been applied to this Application or component, you will see the error message shown below:
This is a reminder that each Tag can have only one value on a given Application or component. You can just click on the existing Tag to type (or select) a replacement Tag Value:
Click Submit to update the tag's value.
Option 2: Remove Tags
You can remove Tags from the same Applications and components where you have Application Permissions to add (attach) Tags. Simply click the Tag's X box, then respond to the confirmation message box shown below.
There is no automatic undo. To restore a removed Tag, you will need to manually re-enter its key and value.