middleware/kubernetes: define consts (#824)
Define two consts Pod and Svc, makes it stand out a little more when used in switches in case. We have opted for a new type, but then you need to convert them all the time with string(Foo).
This commit is contained in:
parent
d0d7f4c89a
commit
21386ebdd5
3 changed files with 22 additions and 17 deletions
|
@ -128,7 +128,7 @@ func TestParseRequest(t *testing.T) {
|
|||
"endpoint": "",
|
||||
"service": "webs",
|
||||
"namespace": "mynamespace",
|
||||
"typeName": "svc",
|
||||
"typeName": Svc,
|
||||
"zone": "inter.webs.test",
|
||||
}
|
||||
for field, expected := range tcs {
|
||||
|
@ -149,7 +149,7 @@ func TestParseRequest(t *testing.T) {
|
|||
"endpoint": "",
|
||||
"service": "*",
|
||||
"namespace": "any",
|
||||
"typeName": "svc",
|
||||
"typeName": Svc,
|
||||
"zone": "inter.webs.test",
|
||||
}
|
||||
for field, expected := range tcs {
|
||||
|
@ -168,7 +168,7 @@ func TestParseRequest(t *testing.T) {
|
|||
"endpoint": "1-2-3-4",
|
||||
"service": "webs",
|
||||
"namespace": "mynamespace",
|
||||
"typeName": "svc",
|
||||
"typeName": Svc,
|
||||
"zone": "inter.webs.test",
|
||||
}
|
||||
for field, expected := range tcs {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue