Merge pull request #36169 from hpcloud/vsphere_bad_conditional

Automatic merge from submit-queue

Bad conditional in vSphereLogin function

```release-note
Fixes NotAuthenticated errors that appear in the kubelet and kube-controller-manager due to never logging in to vSphere
```

With this conditional being == instead of !=, a login would never actually be attempted by this provider, and disk attachments would fail with a NotAuthenticated error from vSphere.
pull/6/head
Kubernetes Submit Queue 2016-12-12 18:51:21 -08:00 committed by GitHub
commit 6c059cb9a1
1 changed files with 5 additions and 2 deletions

View File

@ -338,8 +338,11 @@ func vSphereLogin(ctx context.Context, vs *VSphere) error {
m := session.NewManager(vs.client.Client)
// retrieve client's current session
u, err := m.UserSession(ctx)
if err == nil && u == nil {
// current session is valid
if err != nil {
glog.Errorf("Error while obtaining user session. err: %q", err)
return err
}
if u != nil {
return nil
}