plugin/k8s: fix pods disabled behavior (#1207)
* fix pods disabled behavior * do away with pod mode specific error
This commit is contained in:
parent
5d3bfef732
commit
1a96fd2aee
2 changed files with 2 additions and 5 deletions
|
@ -14,7 +14,6 @@ var podModeDisabledCases = []test.Case{
|
|||
{
|
||||
Qname: "10-240-0-1.podns.pod.cluster.local.", Qtype: dns.TypeA,
|
||||
Rcode: dns.RcodeNameError,
|
||||
Error: errPodsDisabled,
|
||||
Ns: []dns.RR{
|
||||
test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"),
|
||||
},
|
||||
|
@ -22,7 +21,6 @@ var podModeDisabledCases = []test.Case{
|
|||
{
|
||||
Qname: "172-0-0-2.podns.pod.cluster.local.", Qtype: dns.TypeA,
|
||||
Rcode: dns.RcodeNameError,
|
||||
Error: errPodsDisabled,
|
||||
Ns: []dns.RR{
|
||||
test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"),
|
||||
},
|
||||
|
@ -44,7 +42,7 @@ func TestServeDNSModeDisabled(t *testing.T) {
|
|||
|
||||
_, err := k.ServeDNS(ctx, w, r)
|
||||
if err != tc.Error {
|
||||
t.Errorf("Test %d expected no error, got %v", i, err)
|
||||
t.Errorf("Test %d got unexpected error %v", i, err)
|
||||
return
|
||||
}
|
||||
if tc.Error != nil {
|
||||
|
|
|
@ -77,7 +77,6 @@ var (
|
|||
errNoItems = errors.New("no items found")
|
||||
errNsNotExposed = errors.New("namespace is not exposed")
|
||||
errInvalidRequest = errors.New("invalid query name")
|
||||
errPodsDisabled = errors.New("pod records disabled")
|
||||
)
|
||||
|
||||
// Services implements the ServiceBackend interface.
|
||||
|
@ -295,7 +294,7 @@ func endpointHostname(addr api.EndpointAddress, endpointNameMode bool) string {
|
|||
|
||||
func (k *Kubernetes) findPods(r recordRequest, zone string) (pods []msg.Service, err error) {
|
||||
if k.podMode == podModeDisabled {
|
||||
return nil, errPodsDisabled
|
||||
return nil, errNoItems
|
||||
}
|
||||
|
||||
namespace := r.namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue