Skip to content

Commit

Permalink
🐛 fix missing regex update to label val format
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Sep 26, 2023
1 parent 1d1205d commit 3f70841
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/labels/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

const (
LabelValueFmt = "^[a-zA-Z0-9]([-a-zA-Z0-9. ]*[a-zA-Z0-9])?$"
LabelValueFmt = "^[a-zA-Z0-9]([-a-zA-Z0-9. ]*[a-zA-Z0-9+-])?$"
LabelPrefixFmt = "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
exprSpecialSymbols = `!|\|\||&&|\(|\)`
// used to split string into groups of special symbols and everything else
Expand Down
6 changes: 6 additions & 0 deletions engine/labels/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ func TestParseLabel(t *testing.T) {
wantKey: "konveyor.io/fact",
wantVal: "Spring Beans",
},
{
name: "version ranges in values",
label: "konveyor.io/fact=Spring Beans12",
wantKey: "konveyor.io/fact",
wantVal: "Spring Beans12",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 3f70841

Please sign in to comment.