mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 17:24:20 -04:00
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:
committed by
John Belamaric
parent
d0d7f4c89a
commit
21386ebdd5
@@ -25,8 +25,8 @@ func TestStripFederation(t *testing.T) {
|
||||
k := Kubernetes{Zones: []string{"inter.webs.test"}}
|
||||
k.Federations = []Federation{{name: "fed", zone: "era.tion.com"}}
|
||||
|
||||
testStripFederation(t, k, []string{"service", "ns", "fed", "svc"}, "fed", "service.ns.svc")
|
||||
testStripFederation(t, k, []string{"service", "ns", "foo", "svc"}, "", "service.ns.foo.svc")
|
||||
testStripFederation(t, k, []string{"service", "ns", "fed", Svc}, "fed", "service.ns.svc")
|
||||
testStripFederation(t, k, []string{"service", "ns", "foo", Svc}, "", "service.ns.foo.svc")
|
||||
testStripFederation(t, k, []string{"foo", "bar"}, "", "foo.bar")
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user