Skip to content

Commit

Permalink
Remove duplicated label name validation
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Torres <[email protected]>
  • Loading branch information
fedetorres93 committed Sep 23, 2024
1 parent b7d7881 commit ab2490d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions handler/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ func splitLabels(labels string) (map[string]string, error) {
name, value := components[i], components[i+1]
trimmedName := strings.TrimSuffix(name, Base64Suffix)
unescapedName := model.UnescapeName(trimmedName, EscapingScheme)
if !model.LabelNameRE.MatchString(trimmedName) ||
!model.LabelName(unescapedName).IsValid() ||
if !model.LabelName(unescapedName).IsValid() ||
strings.HasPrefix(trimmedName, model.ReservedLabelPrefix) {
return nil, fmt.Errorf("improper label name %q", trimmedName)
}
Expand Down

0 comments on commit ab2490d

Please sign in to comment.