[Portworx] Only check version for online nodes
@@ -2014,7 +2014,10 @@ func (p *portworx) ensureNodesHaveMinVersion(minVersionStr string) (bool, string
pxVerRegex := regexp.MustCompile(`^(\d+\.\d+\.\d+).*`)
for _, node := range result.Nodes {
- nodeVersion := node.NodeLabels["PX Version"]
+ if p.mapNodeStatus(node.Status) != storkvolume.NodeOnline {
+ continue
+ }
+ if nodeVersion, ok := node.NodeLabels["PX Version"]; ok {
matches := pxVerRegex.FindStringSubmatch(nodeVersion)
if len(matches) < 2 {
return false, "", fmt.Errorf("failed to parse PX version: %s on node", nodeVersion)
@@ -2029,6 +2032,7 @@ func (p *portworx) ensureNodesHaveMinVersion(minVersionStr string) (bool, string
return false, fmt.Sprintf("node: %s has version: %s", node.Hostname, nodeVersion), nil
}
}
+ }
return true, "all nodes have expected version", nil
}
