Commit cd291463 authored by FengyunPan's avatar FengyunPan

Fix panic of DeleteRoute()

Fix #48800 It should be 'addr_pairs', not 'routes'.
parent e11020fa
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment