Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 6cdb124

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #50931 from jrperritt/fix-pool-panic
Automatic merge from submit-queue cloudprovider/openstack bug fix: don't try to append pool id if pool doesn't exist **What this PR does / why we need it**: This fixes a bug in the OpenStack cloud provider that could cause a panic. Consider what will happen in the current `LbaasV2.EnsureLoadBalancerDeleted` code if `nil, ErrNotFound` is returned by `getPoolByListenerID`.
2 parents 74a0b93 + 6fce2ce commit 6cdb124

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,12 @@ func (lbaas *LbaasV2) EnsureLoadBalancerDeleted(clusterName string, service *v1.
11441144
if err != nil && err != ErrNotFound {
11451145
return fmt.Errorf("Error getting pool for listener %s: %v", listener.ID, err)
11461146
}
1147-
poolIDs = append(poolIDs, pool.ID)
1148-
// If create-monitor of cloud-config is false, pool has not monitor.
1149-
if pool.MonitorID != "" {
1150-
monitorIDs = append(monitorIDs, pool.MonitorID)
1147+
if pool != nil {
1148+
poolIDs = append(poolIDs, pool.ID)
1149+
// If create-monitor of cloud-config is false, pool has not monitor.
1150+
if pool.MonitorID != "" {
1151+
monitorIDs = append(monitorIDs, pool.MonitorID)
1152+
}
11511153
}
11521154
}
11531155

0 commit comments

Comments
 (0)