Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
08974941
Commit
08974941
authored
Jul 05, 2016
by
Aaron Mills
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change default verbosity settings. Queries should not be logged at v=0
parent
203e1e96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
dns.go
pkg/dns/dns.go
+7
-7
No files found.
pkg/dns/dns.go
View file @
08974941
...
@@ -436,13 +436,13 @@ func (kd *KubeDNS) newHeadlessService(service *kapi.Service) error {
...
@@ -436,13 +436,13 @@ func (kd *KubeDNS) newHeadlessService(service *kapi.Service) error {
// matching the given name is returned, otherwise all records stored under
// matching the given name is returned, otherwise all records stored under
// the subtree matching the name are returned.
// the subtree matching the name are returned.
func
(
kd
*
KubeDNS
)
Records
(
name
string
,
exact
bool
)
(
retval
[]
skymsg
.
Service
,
err
error
)
{
func
(
kd
*
KubeDNS
)
Records
(
name
string
,
exact
bool
)
(
retval
[]
skymsg
.
Service
,
err
error
)
{
glog
.
Infof
(
"Received DNS Request:%s, exact:%v"
,
name
,
exact
)
glog
.
V
(
2
)
.
Infof
(
"Received DNS Request:%s, exact:%v"
,
name
,
exact
)
trimmed
:=
strings
.
TrimRight
(
name
,
"."
)
trimmed
:=
strings
.
TrimRight
(
name
,
"."
)
segments
:=
strings
.
Split
(
trimmed
,
"."
)
segments
:=
strings
.
Split
(
trimmed
,
"."
)
isFederationQuery
:=
false
isFederationQuery
:=
false
federationSegments
:=
[]
string
{}
federationSegments
:=
[]
string
{}
if
!
exact
&&
kd
.
isFederationQuery
(
segments
)
{
if
!
exact
&&
kd
.
isFederationQuery
(
segments
)
{
glog
.
Infof
(
"federation service query: Received federation query. Going to try to find local service first"
)
glog
.
V
(
2
)
.
Infof
(
"federation service query: Received federation query. Going to try to find local service first"
)
// Try quering the non-federation (local) service first.
// Try quering the non-federation (local) service first.
// Will try the federation one later, if this fails.
// Will try the federation one later, if this fails.
isFederationQuery
=
true
isFederationQuery
=
true
...
@@ -471,7 +471,7 @@ func (kd *KubeDNS) Records(name string, exact bool) (retval []skymsg.Service, er
...
@@ -471,7 +471,7 @@ func (kd *KubeDNS) Records(name string, exact bool) (retval []skymsg.Service, er
if
!
kd
.
isHeadlessServiceRecord
(
&
val
)
{
if
!
kd
.
isHeadlessServiceRecord
(
&
val
)
{
ok
,
err
:=
kd
.
serviceWithClusterIPHasEndpoints
(
&
val
)
ok
,
err
:=
kd
.
serviceWithClusterIPHasEndpoints
(
&
val
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Infof
(
"federation service query: unexpected error while trying to find if service has endpoint: %v"
)
glog
.
V
(
2
)
.
Infof
(
"federation service query: unexpected error while trying to find if service has endpoint: %v"
)
continue
continue
}
}
if
!
ok
{
if
!
ok
{
...
@@ -498,7 +498,7 @@ func (kd *KubeDNS) Records(name string, exact bool) (retval []skymsg.Service, er
...
@@ -498,7 +498,7 @@ func (kd *KubeDNS) Records(name string, exact bool) (retval []skymsg.Service, er
// If the name query is not an exact query and does not match any records in the local store,
// If the name query is not an exact query and does not match any records in the local store,
// attempt to send a federation redirect (CNAME) response.
// attempt to send a federation redirect (CNAME) response.
if
!
exact
{
if
!
exact
{
glog
.
Infof
(
"federation service query: Did not find a local service. Trying federation redirect (CNAME) response"
)
glog
.
V
(
2
)
.
Infof
(
"federation service query: Did not find a local service. Trying federation redirect (CNAME) response"
)
return
kd
.
federationRecords
(
reverseArray
(
federationSegments
))
return
kd
.
federationRecords
(
reverseArray
(
federationSegments
))
}
}
...
@@ -536,7 +536,7 @@ func (kd *KubeDNS) getRecordsForPath(path []string, exact bool) ([]skymsg.Servic
...
@@ -536,7 +536,7 @@ func (kd *KubeDNS) getRecordsForPath(path []string, exact bool) ([]skymsg.Servic
for
_
,
val
:=
range
records
{
for
_
,
val
:=
range
records
{
retval
=
append
(
retval
,
*
val
)
retval
=
append
(
retval
,
*
val
)
}
}
glog
.
Infof
(
"records:%v, retval:%v, path:%v"
,
records
,
retval
,
path
)
glog
.
V
(
2
)
.
Infof
(
"records:%v, retval:%v, path:%v"
,
records
,
retval
,
path
)
return
retval
,
nil
return
retval
,
nil
}
}
...
@@ -580,7 +580,7 @@ func (kd *KubeDNS) serviceWithClusterIPHasEndpoints(msg *skymsg.Service) (bool,
...
@@ -580,7 +580,7 @@ func (kd *KubeDNS) serviceWithClusterIPHasEndpoints(msg *skymsg.Service) (bool,
// ReverseRecords performs a reverse lookup for the given name.
// ReverseRecords performs a reverse lookup for the given name.
func
(
kd
*
KubeDNS
)
ReverseRecord
(
name
string
)
(
*
skymsg
.
Service
,
error
)
{
func
(
kd
*
KubeDNS
)
ReverseRecord
(
name
string
)
(
*
skymsg
.
Service
,
error
)
{
glog
.
Infof
(
"Received ReverseRecord Request:%s"
,
name
)
glog
.
V
(
2
)
.
Infof
(
"Received ReverseRecord Request:%s"
,
name
)
// if portalIP is not a valid IP, the reverseRecordMap lookup will fail
// if portalIP is not a valid IP, the reverseRecordMap lookup will fail
portalIP
,
ok
:=
extractIP
(
name
)
portalIP
,
ok
:=
extractIP
(
name
)
...
@@ -657,7 +657,7 @@ func newServiceRecord(ip string, port int) *skymsg.Service {
...
@@ -657,7 +657,7 @@ func newServiceRecord(ip string, port int) *skymsg.Service {
func
getSkyMsg
(
ip
string
,
port
int
)
(
*
skymsg
.
Service
,
string
)
{
func
getSkyMsg
(
ip
string
,
port
int
)
(
*
skymsg
.
Service
,
string
)
{
msg
:=
newServiceRecord
(
ip
,
port
)
msg
:=
newServiceRecord
(
ip
,
port
)
hash
:=
hashServiceRecord
(
msg
)
hash
:=
hashServiceRecord
(
msg
)
glog
.
Infof
(
"DNS Record:%s, hash:%s"
,
fmt
.
Sprintf
(
"%v"
,
msg
),
hash
)
glog
.
V
(
2
)
.
Infof
(
"DNS Record:%s, hash:%s"
,
fmt
.
Sprintf
(
"%v"
,
msg
),
hash
)
return
msg
,
fmt
.
Sprintf
(
"%x"
,
hash
)
return
msg
,
fmt
.
Sprintf
(
"%x"
,
hash
)
}
}
...
...
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