Commit Graph
339 Commits
Author SHA1 Message Date
Bryan Boreham 34dc4dabce Clean up some lint warnings
I ran golangci-lint and it pointed out a few things to clean up.
2020-07-31 10:28:55 +00:00
Bryan Boreham c197624689 Fix up incorrect output formatting 2020-07-31 09:03:27 +00:00
Bryan Boreham 00bc020498 Use Context instead of deprecated http.CloseNotifier interface 2020-07-31 09:03:27 +00:00
Bryan Boreham df52117bfa Remove unused code 2020-07-31 09:03:27 +00:00
Bryan Boreham 6bc656d66c Move address range helpers into address package
This means that users don't drag in a dependency on aws-sdk.
2020-07-29 13:08:35 +00:00
Murali Reddy 640c5c346c add mocks for GossipNeighbourSubset 2019-11-05 13:25:56 +00:00
Bryan Boreham a43bd88ddd Add the error message why an IP claim is denied 2019-10-25 17:13:59 +00:00
Bryan Boreham e8fcd21baa Retry IP allocator claims
It may be that we cannot talk to a peer straight away, so allow claims
to be retried a few times before giving up.
2019-10-25 17:13:11 +00:00
Bryan Boreham 44f91950cb Improve logging of ring merge
Turn some Sprint() calls into `%v` in the outer format string.
Remove one debug log line on duplicate token, since that info is already logged.

Add an Info log line when we accept another peer's token, since that
should be a rare event, and it's important if we've made a mistake.
2019-10-10 11:14:41 +00:00
Bryan Boreham d2f0287fa3 Handle range wrap-around when checking for allocations
Ring wraps around at zero but Space doesn't know about this, so we
have to normalise ranges coming out of Ring.  In turn we may need to
split one range into two, across the end of the Ring.
2019-10-10 11:14:41 +00:00
Bryan Boreham 9c09e36135 refactor: extract function to normalise a single range that may span zero 2019-10-10 11:13:47 +00:00
Bryan Boreham 309a85b29c Merge pull request #3637 from weaveworks/issue-1962
resolve inconsistencies detected during ring merge
2019-06-14 14:24:36 +01:00
Murali Reddy 90ccc4a014 use space to check if entry in a range has allocations while doing ring merge 2019-06-07 18:12:35 +05:30
Murali Reddy 5e69e8a7b4 check for allocations in the range that got transffered when its split 2019-05-13 20:02:36 +05:30
Murali Reddy 2d912263b1 add ring debug log during merge() 2019-05-13 12:43:19 +05:30
Murali Reddy 51d7f455c9 move code to reset the entry free space from entries.merge() to Ring.Merge() 2019-05-10 17:23:45 +05:30
Murali Reddy 89db74338e during merge we receive update to an entry that ring owns, and has a newer version, set our version to the one received plus one, effectively imposing our existing entry 2019-05-09 16:05:22 +05:30
Bryan Boreham 27848992b1 Merge branch '2.5' 2019-05-07 13:32:55 +00:00
Bryan Boreham 760bc10074 Merge pull request #3629 from weaveworks/issue-3628
gossip broadcast updated ring on donating a range to other peer
2019-05-03 16:32:23 +01:00
Murali Reddy 11c55a3a07 fix lint 2019-05-03 10:55:13 +05:30
Murali Reddy a400d43df7 resolve inconsistencies detected during ring merge
Fixes #1962
2019-05-03 10:55:13 +05:30
Murali Reddy 4f8fe2c13f gossip broadcast updated rin on donating a range to other peer
Fixes #3628
2019-04-26 15:21:23 +05:30
Murali Reddy 873781ab58 bump up the version of entry by large value so that transfer of range
takes precedence (if there is any conflict in merging entry) over
other operations on the entry that increments the version

Fixes #3612
2019-04-26 15:15:47 +05:30
Murali Reddy 06e0e6ace0 add debug log for ipam ring and entry updates
Fixes #3627
2019-04-09 12:39:16 +05:30
Murali Reddy 7141ccc271 prevent a case where tryOps endsup called recursivley when persisted data exists
but has empty data

Fixes #3067
2018-09-26 16:10:06 +05:30
Martynas Pumputis 79f77f94f4 ipam: Do not deref nil in GET /ipinfo/tracker if tracker doesn't exist
In some cases, we do not create any IPAM tracker, which leads
to a panic when GET'ing /ipinfo/tracker.
2018-09-21 13:29:03 +03:00
Martynas Pumputis 4f99efaaf4 Export tracker.RemoveCommon and tracker.Merge
It's going to be used by NoMasqLocalTracker.
2018-06-04 14:08:24 +02:00
Martynas Pumputis 62c30d9130 Extern LocalRangeTracker interface with String method
Cleaner approach than passing a tracker name to ipam/http.
2018-06-04 14:08:24 +02:00
Bryan Boreham 847046a225 Update to match upstream changes 2018-04-27 14:34:48 +01:00
Martynas Pumputis d35d931179 Fix invalid format in ipam/testutils_test.go
Caught after upgrading Go to 1.10 in build tools.
2018-03-12 11:04:41 +00:00
Marc CARRE 00036ec277 Merge remote-tracking branch 'origin/1.9' 2017-06-09 08:30:34 +01:00
Bryan Boreham b01a204c1f Check who previously owned an address claimed outside the range 2017-06-08 16:25:09 +00:00
Bryan Boreham e9310eba98 Don't use '_' as container ID in claim outside range
And added unit test for various claim-without-ID situations
2017-06-07 16:38:19 +00:00
Bryan Boreham 986a3f8079 Pass bridge name into awsvpc 2017-04-17 19:41:47 +00:00
Marc CARRE b753bcd982 Merge remote-tracking branch 'origin/ipam-ops-reentrant' 2017-04-12 13:19:52 +01:00
Bryan Boreham 1c1b3248c0 Make sure we have a ring before calling tryOps()
because otherwise the pending ops can be modified from inside Try()
2017-04-11 15:36:53 +00:00
Bryan Boreham 768f89c3de Move peer http handlers from ipam to weaver 2017-04-10 14:09:06 +00:00
Bryan Boreham d0e0df9bd4 Merge pull request #1350 from weaveworks/ipam-json
Add GET /ip handler to return all IPAM mappings.
2017-04-06 10:09:01 +01:00
Bryan Boreham 8f27f8f442 Clean up some tests that were not checking results 2017-03-21 11:38:35 +00:00
Bryan Boreham 1af5699948 cancelOp was cancelling the first op in the queue 2017-03-21 11:38:35 +00:00
Tom Wilkie c06d4d1b00 Add GET /ip handler to return all IPAM mappings. 2017-03-10 11:39:47 +00:00
Bryan Boreham 4e37f5ec42 Add explanations of various claim and allocation fields 2017-02-13 17:31:02 +00:00
Bryan Boreham 7075b5d9fd Extend pre-existing address reclaim to docker containers 2017-02-13 11:30:34 +00:00
Bryan Boreham 39ac1a0037 Collect existing weave addresses at start-up, to avoid a race when
doing it from the script

Note we need to run weaver in the host pid namespace, so it can search
for existing container IPs. Also now we are firing off sub-processes
it's better to not be PID 1 so Linux doesn't expect us to reap zombies.
2017-02-10 15:10:02 +00:00
Bryan Boreham 30d6639a98 Refactor: move peer name identifier to DB package 2017-01-11 13:05:25 +00:00
Adam Harrison c3a2539445 Merge branch '1.8' 2016-11-22 16:17:30 +00:00
Bryan Boreham d5f1c233bf Remove punctuation from the end of error messages
to placate the linter
2016-11-18 10:40:41 +00:00
Bryan Boreham e42600632f Don't release dead container's IP addresses if not asked to check it is alive. 2016-11-14 19:53:54 +00:00
Adam Harrison 915638d17a Address linter failures 2016-11-14 15:13:19 +00:00
Marc CARRE 0544901357 Factorise "_" duplicates as a constant. 2016-11-11 17:00:26 +00:00