diff --git a/ipam/allocate.go b/ipam/allocate.go index ac542aac..c4092a12 100644 --- a/ipam/allocate.go +++ b/ipam/allocate.go @@ -14,9 +14,9 @@ type allocateResult struct { type allocate struct { resultChan chan<- allocateResult - ident string + ident string // a container ID, something like "weave:expose", or api.NoContainerID r address.CIDR // Subnet we are trying to allocate within - isContainer bool + isContainer bool // true if ident is a container ID hasBeenCancelled func() bool } diff --git a/ipam/allocator.go b/ipam/allocator.go index 71b21309..6ad7a540 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -76,9 +76,10 @@ type Allocator struct { now func() time.Time } +// PreClaims are IP addresses discovered before we could initialize IPAM type PreClaim struct { - Ident string - IsContainer bool + Ident string // a container ID, something like "weave:expose", or api.NoContainerID + IsContainer bool // true if Ident is a container ID Cidr address.CIDR } diff --git a/ipam/claim.go b/ipam/claim.go index dfd3ab76..9a827e54 100644 --- a/ipam/claim.go +++ b/ipam/claim.go @@ -12,10 +12,10 @@ import ( type claim struct { resultChan chan<- error - ident string - cidr address.CIDR - isContainer bool - noErrorOnUnknown bool + ident string // a container ID, something like "weave:expose", or api.NoContainerID + cidr address.CIDR // single address being claimed + isContainer bool // true if ident is a container ID + noErrorOnUnknown bool // if false, error or block if we don't know; if true return ok but keep trying hasBeenCancelled func() bool }