From 1af569994843fd2c467a11a5eb8209c40111d677 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 20 Mar 2017 15:42:34 +0000 Subject: [PATCH] cancelOp was cancelling the first op in the queue --- ipam/allocator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipam/allocator.go b/ipam/allocator.go index 6ad7a540..8f1a699f 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -210,9 +210,9 @@ func (alloc *Allocator) doOperation(op operation, ops *[]operation) { // already succeeded. If it is on the queue, we call // cancel on it, allowing callers waiting for the resultChans // to unblock. -func (alloc *Allocator) cancelOp(op operation, ops *[]operation) { +func (alloc *Allocator) cancelOp(opToCancel operation, ops *[]operation) { for i, op := range *ops { - if op == op { + if op == opToCancel { *ops = append((*ops)[:i], (*ops)[i+1:]...) op.Cancel() break