mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
plugin/kubernetes: Add upstream @self and loop count (#1484)
* add upstream @self and loop count * 1st round of feedback * allow argless upstream * update test * readmes * feedback
This commit is contained in:
committed by
Miek Gieben
parent
ee8084a08f
commit
71ee323651
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/coredns/coredns/plugin/pkg/fall"
|
||||
|
||||
"github.com/coredns/coredns/plugin/proxy"
|
||||
"github.com/mholt/caddy"
|
||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
@@ -463,7 +464,10 @@ kubernetes cluster.local`,
|
||||
t.Errorf("Test %d: Expected kubernetes controller to be initialized with fallthrough '%v'. Instead found fallthrough '%v' for input '%s'", i, test.expectedFallthrough, k8sController.Fall, test.input)
|
||||
}
|
||||
// upstream
|
||||
foundUpstreams := k8sController.Proxy.Upstreams
|
||||
var foundUpstreams *[]proxy.Upstream
|
||||
if k8sController.Upstream.Forward != nil {
|
||||
foundUpstreams = k8sController.Upstream.Forward.Upstreams
|
||||
}
|
||||
if test.expectedUpstreams == nil {
|
||||
if foundUpstreams != nil {
|
||||
t.Errorf("Test %d: Expected kubernetes controller to not be initialized with upstreams for input '%s'", i, test.input)
|
||||
|
||||
Reference in New Issue
Block a user