Skip to content

Commit

Permalink
Don't filter master node while listing nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh Desai committed May 10, 2017
1 parent 7636a27 commit 4164374
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions pkg/volume/portworx/portworx_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ import (
)

const (
osdMgmtPort = "9001"
osdDriverVersion = "v1"
pxdDriverName = "pxd"
pwxSockName = "pwx"
pvcClaimLabel = "pvc"
labelNodeRoleMaster = "node-role.kubernetes.io/master"
osdMgmtPort = "9001"
osdDriverVersion = "v1"
pxdDriverName = "pxd"
pvcClaimLabel = "pvc"
)

type PortworxVolumeUtil struct {
Expand Down Expand Up @@ -164,13 +162,13 @@ func (util *PortworxVolumeUtil) osdClient(volumeHost volume.VolumeHost) (osdvolu
return nil, err
}

OUTER:
for _, node := range nodes.Items {
if _, present := node.Labels[labelNodeRoleMaster]; present {
continue
}

for _, n := range node.Status.Addresses {
if n.Address == volumeHost.GetHostName() {
continue // this address is already tested and known to fail
}

glog.Infof("Testing node: %v as px api server\n", n.Address)
driverClient, err = getValidatedOsdClient(n.Address)
if err != nil {
e = err
Expand All @@ -179,7 +177,7 @@ func (util *PortworxVolumeUtil) osdClient(volumeHost volume.VolumeHost) (osdvolu

if driverClient != nil {
util.portworxClient = driverClient
break OUTER
return volumeclient.VolumeDriver(util.portworxClient), nil
}
}
}
Expand Down

0 comments on commit 4164374

Please sign in to comment.