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
9a219513
Commit
9a219513
authored
Jul 06, 2018
by
Doug MacEachern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vSphere Cloud Provider: avoid read race during logout
The Client nil check was added in
6d1c4a3c
, but there was not any go test coverage of that code path until
e22f9ca4
Fixes #65696
parent
91b72934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
connection.go
pkg/cloudprovider/providers/vsphere/vclib/connection.go
+8
-1
vsphere.go
pkg/cloudprovider/providers/vsphere/vsphere.go
+1
-4
No files found.
pkg/cloudprovider/providers/vsphere/vclib/connection.go
View file @
9a219513
...
...
@@ -131,7 +131,14 @@ func (connection *VSphereConnection) login(ctx context.Context, client *vim25.Cl
// Logout calls SessionManager.Logout for the given connection.
func
(
connection
*
VSphereConnection
)
Logout
(
ctx
context
.
Context
)
{
m
:=
session
.
NewManager
(
connection
.
Client
)
clientLock
.
Lock
()
c
:=
connection
.
Client
clientLock
.
Unlock
()
if
c
==
nil
{
return
}
m
:=
session
.
NewManager
(
c
)
hasActiveSession
,
err
:=
m
.
SessionIsActive
(
ctx
)
if
err
!=
nil
{
...
...
pkg/cloudprovider/providers/vsphere/vsphere.go
View file @
9a219513
...
...
@@ -510,11 +510,8 @@ func buildVSphereFromConfig(cfg VSphereConfig) (*VSphere, error) {
func
logout
(
vs
*
VSphere
)
{
for
_
,
vsphereIns
:=
range
vs
.
vsphereInstanceMap
{
if
vsphereIns
.
conn
.
Client
!=
nil
{
vsphereIns
.
conn
.
Logout
(
context
.
TODO
())
}
vsphereIns
.
conn
.
Logout
(
context
.
TODO
())
}
}
// Instances returns an implementation of Instances for vSphere.
...
...
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