Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
c147e203
Commit
c147e203
authored
May 07, 2019
by
Chris O'Haver
Committed by
John Belamaric
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make ignore empty work with ext svc types (#2823)
parent
6e1c57ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
plugin/kubernetes/handler_ignore_emptyservice_test.go
plugin/kubernetes/handler_ignore_emptyservice_test.go
+8
-0
plugin/kubernetes/kubernetes.go
plugin/kubernetes/kubernetes.go
+3
-1
No files found.
plugin/kubernetes/handler_ignore_emptyservice_test.go
View file @
c147e203
...
@@ -19,6 +19,14 @@ var dnsEmptyServiceTestCases = []test.Case{
...
@@ -19,6 +19,14 @@ var dnsEmptyServiceTestCases = []test.Case{
test
.
SOA
(
"cluster.local. 5 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 5"
),
test
.
SOA
(
"cluster.local. 5 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 5"
),
},
},
},
},
// CNAME to external
{
Qname
:
"external.testns.svc.cluster.local."
,
Qtype
:
dns
.
TypeCNAME
,
Rcode
:
dns
.
RcodeSuccess
,
Answer
:
[]
dns
.
RR
{
test
.
CNAME
(
"external.testns.svc.cluster.local. 5 IN CNAME ext.interwebs.test."
),
},
},
}
}
func
TestServeDNSEmptyService
(
t
*
testing
.
T
)
{
func
TestServeDNSEmptyService
(
t
*
testing
.
T
)
{
...
...
plugin/kubernetes/kubernetes.go
View file @
c147e203
...
@@ -439,7 +439,9 @@ func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg.
...
@@ -439,7 +439,9 @@ func (k *Kubernetes) findServices(r recordRequest, zone string) (services []msg.
continue
continue
}
}
if
k
.
opts
.
ignoreEmptyService
&&
svc
.
ClusterIP
!=
api
.
ClusterIPNone
{
// If "ignore empty_service" option is set and no endpoints exist, return NXDOMAIN unless
// it's a headless or externalName service (covered below).
if
k
.
opts
.
ignoreEmptyService
&&
svc
.
ClusterIP
!=
api
.
ClusterIPNone
&&
svc
.
Type
!=
api
.
ServiceTypeExternalName
{
// serve NXDOMAIN if no endpoint is able to answer
// serve NXDOMAIN if no endpoint is able to answer
podsCount
:=
0
podsCount
:=
0
for
_
,
ep
:=
range
endpointsListFunc
()
{
for
_
,
ep
:=
range
endpointsListFunc
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment