don't try to add pool id if pool doesn't exist

pull/6/head
jrperritt 2017-08-18 16:49:23 -05:00
parent 683f09c65e
commit 21ce3de326
1 changed files with 6 additions and 4 deletions

View File

@ -1144,10 +1144,12 @@ func (lbaas *LbaasV2) EnsureLoadBalancerDeleted(clusterName string, service *v1.
if err != nil && err != ErrNotFound { if err != nil && err != ErrNotFound {
return fmt.Errorf("Error getting pool for listener %s: %v", listener.ID, err) return fmt.Errorf("Error getting pool for listener %s: %v", listener.ID, err)
} }
poolIDs = append(poolIDs, pool.ID) if pool != nil {
// If create-monitor of cloud-config is false, pool has not monitor. poolIDs = append(poolIDs, pool.ID)
if pool.MonitorID != "" { // If create-monitor of cloud-config is false, pool has not monitor.
monitorIDs = append(monitorIDs, pool.MonitorID) if pool.MonitorID != "" {
monitorIDs = append(monitorIDs, pool.MonitorID)
}
} }
} }