Skip to content

Commit

Permalink
label templates: fix sanitization section (#369)
Browse files Browse the repository at this point in the history
invalid chars are substituted with an hyphen, not an underscore:
fix the documentation

Fixes #365

Signed-off-by: Francesco Giudici <[email protected]>
  • Loading branch information
fgiudici authored Aug 30, 2024
1 parent b4df9ee commit 2721f2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/label-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ Template variables can be mixed with static text to form the actual labels assig
Once the label template value has been rendered accordingly to the included [label template variables](#label-template-variables), the resulting value is `sanitized` before being assigned to the resulting label.

**The `sanitization` enforce the label value to only contain letters (capitalized or not), numbers and the hyphen (`-`), point (`.`) and underscore (`_`) characters**:
all the characters not included are substituted with an underscore.
all the characters not included are substituted with an hyphen.

If an underscore is at the beginning or at the end of the label value, it is dropped.
Any character at the beginning and at the end of the label value must be a letter or a number.
If it is not, it is dropped.

Two consecutive underscores are replaced with one.
Two consecutive hyphens are replaced with one.

:::note Rendering Example
* Template label with not allowed chars sanitization:
Expand Down

0 comments on commit 2721f2b

Please sign in to comment.