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
813d264c
Commit
813d264c
authored
Aug 11, 2017
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete load balancers if the UIDs for services don't match.
parent
4e3d37c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
service_controller.go
pkg/controller/service/service_controller.go
+12
-1
No files found.
pkg/controller/service/service_controller.go
View file @
813d264c
...
@@ -223,7 +223,14 @@ func (s *ServiceController) init() error {
...
@@ -223,7 +223,14 @@ func (s *ServiceController) init() error {
// indicating whether processing should be retried; zero means no-retry; otherwise
// indicating whether processing should be retried; zero means no-retry; otherwise
// we should retry in that Duration.
// we should retry in that Duration.
func
(
s
*
ServiceController
)
processServiceUpdate
(
cachedService
*
cachedService
,
service
*
v1
.
Service
,
key
string
)
(
error
,
time
.
Duration
)
{
func
(
s
*
ServiceController
)
processServiceUpdate
(
cachedService
*
cachedService
,
service
*
v1
.
Service
,
key
string
)
(
error
,
time
.
Duration
)
{
if
cachedService
.
state
!=
nil
{
if
cachedService
.
state
.
UID
!=
service
.
UID
{
err
,
retry
:=
s
.
processLoadBalancerDelete
(
cachedService
,
key
)
if
err
!=
nil
{
return
err
,
retry
}
}
}
// cache the service, we need the info for service deletion
// cache the service, we need the info for service deletion
cachedService
.
state
=
service
cachedService
.
state
=
service
err
,
retry
:=
s
.
createLoadBalancerIfNeeded
(
key
,
service
)
err
,
retry
:=
s
.
createLoadBalancerIfNeeded
(
key
,
service
)
...
@@ -765,6 +772,10 @@ func (s *ServiceController) processServiceDeletion(key string) (error, time.Dura
...
@@ -765,6 +772,10 @@ func (s *ServiceController) processServiceDeletion(key string) (error, time.Dura
if
!
ok
{
if
!
ok
{
return
fmt
.
Errorf
(
"Service %s not in cache even though the watcher thought it was. Ignoring the deletion."
,
key
),
doNotRetry
return
fmt
.
Errorf
(
"Service %s not in cache even though the watcher thought it was. Ignoring the deletion."
,
key
),
doNotRetry
}
}
return
s
.
processLoadBalancerDelete
(
cachedService
,
key
)
}
func
(
s
*
ServiceController
)
processLoadBalancerDelete
(
cachedService
*
cachedService
,
key
string
)
(
error
,
time
.
Duration
)
{
service
:=
cachedService
.
state
service
:=
cachedService
.
state
// delete load balancer info only if the service type is LoadBalancer
// delete load balancer info only if the service type is LoadBalancer
if
!
wantsLoadBalancer
(
service
)
{
if
!
wantsLoadBalancer
(
service
)
{
...
...
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