Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from uswitch/slashes-are-valid-in-keys
Browse files Browse the repository at this point in the history
LabelSelector should support / chars in keys
  • Loading branch information
ericchiang authored Apr 20, 2017
2 parents c43ac68 + 8e3f6e1 commit 929412d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

const (
qnameCharFmt string = "[A-Za-z0-9]"
qnameExtCharFmt string = "[-A-Za-z0-9_.]"
qnameExtCharFmt string = "[-A-Za-z0-9_./]"
qualifiedNameFmt string = "(" + qnameCharFmt + qnameExtCharFmt + "*)?" + qnameCharFmt
qualifiedNameMaxLength int = 63
labelValueFmt string = "(" + qualifiedNameFmt + ")?"
Expand Down
6 changes: 6 additions & 0 deletions labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ func TestLabelSelector(t *testing.T) {
},
want: "component=frontend",
},
{
f: func(l *LabelSelector) {
l.Eq("kubernetes.io/role", "master")
},
want: "kubernetes.io/role=master",
},
{
f: func(l *LabelSelector) {
l.In("type", "prod", "staging")
Expand Down

0 comments on commit 929412d

Please sign in to comment.