Skip to content

Commit

Permalink
Merge branch 'master' into async-sql-errs2
Browse files Browse the repository at this point in the history
  • Loading branch information
jskulavik authored Apr 3, 2020
2 parents 1dffba4 + 8bc085b commit b90de36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions pkg/helpers/helpers_labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ func TestLabelsToTags(t *testing.T) {
"fun..zone": to.StringPtr("null"),
},
},
{
Name: "question mark labels",
In: map[string]string{
"age?date": "null",
"type?kind": "null",
"fun??zone": "null",
},
Out: map[string]*string{
"age.date": to.StringPtr("null"),
"type.kind": to.StringPtr("null"),
"fun..zone": to.StringPtr("null"),
},
},
{
Name: "percent labels",
In: map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion pkg/helpers/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func LabelsToTags(in map[string]string) map[string]*string {
newK := k
value := v
if strings.ContainsAny(k, "<>%/?\\") {
newK = ReplaceAny(k, []string{"<", ">", "%", "/", "\\\\", "?"})
newK = ReplaceAny(k, []string{"<", ">", "%", "/", "\\\\", "\\?"})
}
out[newK] = &value
}
Expand Down

0 comments on commit b90de36

Please sign in to comment.