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
60798e7c
Commit
60798e7c
authored
Jul 29, 2016
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep retry times the same for each place where ensureDnsRecords is called.
parent
c5e1e661
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
endpoint_helper.go
...tion/pkg/federation-controller/service/endpoint_helper.go
+16
-19
No files found.
federation/pkg/federation-controller/service/endpoint_helper.go
View file @
60798e7c
...
...
@@ -109,7 +109,7 @@ func (cc *clusterClientCache) processEndpointDeletion(cachedService *cachedServi
if
err
==
nil
{
return
nil
}
glog
.
Infof
(
"Error ensuring DNS Records: %v"
,
err
)
glog
.
V
(
4
)
.
Infof
(
"Error ensuring DNS Records: %v"
,
err
)
time
.
Sleep
(
cachedService
.
nextDNSUpdateDelay
())
}
}
...
...
@@ -120,6 +120,7 @@ func (cc *clusterClientCache) processEndpointDeletion(cachedService *cachedServi
// We do not care about the endpoint info, what we need to make sure here is len(endpoints.subsets)>0
func
(
cc
*
clusterClientCache
)
processEndpointUpdate
(
cachedService
*
cachedService
,
endpoint
*
v1
.
Endpoints
,
clusterName
string
,
serviceController
*
ServiceController
)
error
{
glog
.
V
(
4
)
.
Infof
(
"Processing endpoint update for %s/%s, cluster %s"
,
endpoint
.
Namespace
,
endpoint
.
Name
,
clusterName
)
var
err
error
cachedService
.
rwlock
.
Lock
()
var
reachable
bool
defer
cachedService
.
rwlock
.
Unlock
()
...
...
@@ -135,17 +136,15 @@ func (cc *clusterClientCache) processEndpointUpdate(cachedService *cachedService
// first time get endpoints, update dns record
glog
.
V
(
4
)
.
Infof
(
"Reachable endpoint was found for %s/%s, cluster %s, building endpointMap"
,
endpoint
.
Namespace
,
endpoint
.
Name
,
clusterName
)
cachedService
.
endpointMap
[
clusterName
]
=
1
if
err
:=
serviceController
.
ensureDnsRecords
(
clusterName
,
cachedService
);
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"Error ensuring DNS Records: %v"
,
err
)
for
i
:=
0
;
i
<
clientRetryCount
;
i
++
{
time
.
Sleep
(
cachedService
.
nextDNSUpdateDelay
())
err
:=
serviceController
.
ensureDnsRecords
(
clusterName
,
cachedService
)
if
err
==
nil
{
return
nil
}
for
i
:=
0
;
i
<
clientRetryCount
;
i
++
{
err
:=
serviceController
.
ensureDnsRecords
(
clusterName
,
cachedService
)
if
err
==
nil
{
return
nil
}
return
err
glog
.
V
(
4
)
.
Infof
(
"Error ensuring DNS Records: %v"
,
err
)
time
.
Sleep
(
cachedService
.
nextDNSUpdateDelay
())
}
return
err
}
}
else
{
for
_
,
subset
:=
range
endpoint
.
Subsets
{
...
...
@@ -158,17 +157,15 @@ func (cc *clusterClientCache) processEndpointUpdate(cachedService *cachedService
// first time get endpoints, update dns record
glog
.
V
(
4
)
.
Infof
(
"Reachable endpoint was lost for %s/%s, cluster %s, deleting endpointMap"
,
endpoint
.
Namespace
,
endpoint
.
Name
,
clusterName
)
delete
(
cachedService
.
endpointMap
,
clusterName
)
if
err
:=
serviceController
.
ensureDnsRecords
(
clusterName
,
cachedService
);
err
!=
nil
{
glog
.
V
(
4
)
.
Infof
(
"Error ensuring DNS Records: %v"
,
err
)
for
i
:=
0
;
i
<
clientRetryCount
;
i
++
{
time
.
Sleep
(
cachedService
.
nextDNSUpdateDelay
())
err
:=
serviceController
.
ensureDnsRecords
(
clusterName
,
cachedService
)
if
err
==
nil
{
return
nil
}
for
i
:=
0
;
i
<
clientRetryCount
;
i
++
{
err
:=
serviceController
.
ensureDnsRecords
(
clusterName
,
cachedService
)
if
err
==
nil
{
return
nil
}
return
err
glog
.
V
(
4
)
.
Infof
(
"Error ensuring DNS Records: %v"
,
err
)
time
.
Sleep
(
cachedService
.
nextDNSUpdateDelay
())
}
return
err
}
}
return
nil
...
...
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