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
e750ee50
Commit
e750ee50
authored
Mar 10, 2022
by
Brad Davidson
Committed by
Brad Davidson
Mar 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close additional leaked GPRC clients
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
e0327046
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
controller.go
pkg/apiaddresses/controller.go
+5
-1
etcd.go
pkg/etcd/etcd.go
+17
-0
No files found.
pkg/apiaddresses/controller.go
View file @
e750ee50
...
@@ -28,9 +28,13 @@ func Register(ctx context.Context, runtime *config.ControlRuntime, endpoints con
...
@@ -28,9 +28,13 @@ func Register(ctx context.Context, runtime *config.ControlRuntime, endpoints con
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
h
.
etcdClient
=
cl
h
.
etcdClient
=
cl
go
func
()
{
<-
ctx
.
Done
()
h
.
etcdClient
.
Close
()
}()
return
nil
return
nil
}
}
...
...
pkg/etcd/etcd.go
View file @
e750ee50
...
@@ -146,6 +146,11 @@ func (e *ETCD) SetControlConfig(ctx context.Context, config *config.Control) err
...
@@ -146,6 +146,11 @@ func (e *ETCD) SetControlConfig(ctx context.Context, config *config.Control) err
}
}
e
.
client
=
client
e
.
client
=
client
go
func
()
{
<-
ctx
.
Done
()
e
.
client
.
Close
()
}()
address
,
err
:=
GetAdvertiseAddress
(
config
.
PrivateIP
)
address
,
err
:=
GetAdvertiseAddress
(
config
.
PrivateIP
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -473,6 +478,11 @@ func (e *ETCD) Register(ctx context.Context, config *config.Control, handler htt
...
@@ -473,6 +478,11 @@ func (e *ETCD) Register(ctx context.Context, config *config.Control, handler htt
}
}
e
.
client
=
client
e
.
client
=
client
go
func
()
{
<-
ctx
.
Done
()
e
.
client
.
Close
()
}()
address
,
err
:=
GetAdvertiseAddress
(
config
.
PrivateIP
)
address
,
err
:=
GetAdvertiseAddress
(
config
.
PrivateIP
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -1034,6 +1044,11 @@ func (e *ETCD) preSnapshotSetup(ctx context.Context, config *config.Control) err
...
@@ -1034,6 +1044,11 @@ func (e *ETCD) preSnapshotSetup(ctx context.Context, config *config.Control) err
return
err
return
err
}
}
e
.
client
=
client
e
.
client
=
client
go
func
()
{
<-
ctx
.
Done
()
e
.
client
.
Close
()
}()
}
}
return
nil
return
nil
}
}
...
@@ -1895,6 +1910,8 @@ func GetAPIServerURLsFromETCD(ctx context.Context, cfg *config.Control) ([]strin
...
@@ -1895,6 +1910,8 @@ func GetAPIServerURLsFromETCD(ctx context.Context, cfg *config.Control) ([]strin
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
defer
cl
.
Close
()
etcdResp
,
err
:=
cl
.
KV
.
Get
(
ctx
,
AddressKey
)
etcdResp
,
err
:=
cl
.
KV
.
Get
(
ctx
,
AddressKey
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
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