mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Applying changes per PR feedback -
Check for error conditions from the vSphere API and return the err if one occurs. The vSphere API does not return an err for unauthenticated users, it just returns a nil user object.
This commit is contained in:
parent
16226c0e18
commit
2cb5b5ec0e
@ -360,8 +360,11 @@ func vSphereLogin(vs *VSphere, ctx context.Context) error {
|
|||||||
m := session.NewManager(vs.client.Client)
|
m := session.NewManager(vs.client.Client)
|
||||||
// retrieve client's current session
|
// retrieve client's current session
|
||||||
u, err := m.UserSession(ctx)
|
u, err := m.UserSession(ctx)
|
||||||
if err == nil && u != nil {
|
if err != nil {
|
||||||
// current session is valid
|
glog.Errorf("Error while obtaining user session. err: %q", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if u != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user