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:
Miek Gieben 2017-08-04 07:34:00 -07:00 committed by John Belamaric
parent d0d7f4c89a
commit 21386ebdd5
3 changed files with 22 additions and 17 deletions

View file

@ -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 {