Fix panic of DeleteRoute()

Fix #48800
It should be 'addr_pairs', not 'routes'.
This commit is contained in:
FengyunPan
2017-07-12 17:28:58 +08:00
parent e11020fa39
commit cd29146317

View File

@@ -262,8 +262,8 @@ func (r *Routes) DeleteRoute(clusterName string, route *cloudprovider.Route) err
if index != -1 {
// Delete element `index`
addr_pairs[index] = addr_pairs[len(routes)-1]
addr_pairs = addr_pairs[:len(routes)-1]
addr_pairs[index] = addr_pairs[len(addr_pairs)-1]
addr_pairs = addr_pairs[:len(addr_pairs)-1]
unwind, err := updateAllowedAddressPairs(r.network, &port, addr_pairs)
if err != nil {