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
13fef231
Commit
13fef231
authored
May 18, 2016
by
Madhusudan.C.S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To get the zone information, select a node which actually has that annotation.
Also, use the cluster zone information while generating the CNAME response for federation queries.
parent
3ee2b765
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
dns.go
pkg/dns/dns.go
+13
-1
No files found.
pkg/dns/dns.go
View file @
13fef231
...
@@ -533,6 +533,11 @@ func (kd *KubeDNS) federationRecords(queryPath []string) ([]skymsg.Service, erro
...
@@ -533,6 +533,11 @@ func (kd *KubeDNS) federationRecords(queryPath []string) ([]skymsg.Service, erro
path
=
path
[
:
len
(
path
)
-
len
(
kd
.
domainPath
)]
path
=
path
[
:
len
(
path
)
-
len
(
kd
.
domainPath
)]
// Append the zone name (zone in the cloud provider terminology, not a DNS zone)
// Append the zone name (zone in the cloud provider terminology, not a DNS zone)
zone
,
err
:=
kd
.
getClusterZone
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to obtain the cluster zone: %v"
,
err
)
}
path
=
append
(
path
,
zone
)
// We have already established that the map entry exists for the given federation,
// We have already established that the map entry exists for the given federation,
// we just need to retrieve the domain name, validate it and append it to the path.
// we just need to retrieve the domain name, validate it and append it to the path.
...
@@ -578,11 +583,18 @@ func (kd *KubeDNS) getClusterZone() (string, error) {
...
@@ -578,11 +583,18 @@ func (kd *KubeDNS) getClusterZone() (string, error) {
return
""
,
fmt
.
Errorf
(
"failed to retrieve the cluster nodes: %v"
,
err
)
return
""
,
fmt
.
Errorf
(
"failed to retrieve the cluster nodes: %v"
,
err
)
}
}
node
=
&
nodeList
.
Items
[
0
]
// Select a node (arbitrarily the first node) that has `LabelZoneFailureDomain` set.
for
_
,
nodeItem
:=
range
nodeList
.
Items
{
if
_
,
ok
:=
nodeItem
.
Annotations
[
unversioned
.
LabelZoneFailureDomain
];
!
ok
{
continue
}
// Make a copy of the node, don't rely on the loop variable.
node
=
&
(
*
(
&
nodeItem
))
if
err
:=
kd
.
nodesStore
.
Add
(
node
);
err
!=
nil
{
if
err
:=
kd
.
nodesStore
.
Add
(
node
);
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"couldn't add the retrieved node to the cache: %v"
,
err
)
return
""
,
fmt
.
Errorf
(
"couldn't add the retrieved node to the cache: %v"
,
err
)
}
}
}
}
}
zone
,
ok
:=
node
.
Annotations
[
unversioned
.
LabelZoneFailureDomain
]
zone
,
ok
:=
node
.
Annotations
[
unversioned
.
LabelZoneFailureDomain
]
if
!
ok
||
zone
==
""
{
if
!
ok
||
zone
==
""
{
...
...
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