Murali Reddy
a400d43df7
resolve inconsistencies detected during ring merge
...
Fixes #1962
2019-05-03 10:55:13 +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
Marc CARRE
bc94633180
Re-claim IP on start-up when an existing ID has been found.
...
- Rewrote conditions to keep c.ident immutable and hopefully makes
things clearer.
- Added a case to tolerate reclaim after we have used CNI (passed CID
is “_” and existing CID is a real container ID).
2016-11-11 17:00:26 +00:00
Bryan Boreham
6d5af85eee
Report count of active IP addresses in status
2016-10-20 14:04:41 +01:00
Bryan Boreham
1ae2d33714
Remove old-style 'expvar' metrics
2016-10-20 13:54:42 +01:00
Martynas Pumputis
58caf38f07
Fix re-attaching of weave router in awsvpc mode
...
In order to re-attach the router and make it work in awsvpc mode,
the following has to be done:
- expose_ip on the router
- adjusting arp settings
- restoring host routes
To detect that we run in awsvpc mode, we inspect cmd parameters
of the weave router instead of GET'ing /ipinfo/tracker. This is so,
because the HTTP server started by the router might not be running
at the time of restoration.
2016-06-29 11:15:49 +01:00
Martynas Pumputis
8569cbd4a3
Force transferring of IPAM ranges in a case of Shutdown
...
If no peer for transfer is found, we transfer them to
mesh.UnknownPeerName to notify the ring update tracker.
Makes the awsvpc tracker to remove local entries from
the VPC route table when the last peer calls "weave reset".
2016-06-10 11:51:31 +01:00
Adam Harrison
adcb1018df
Merge pull request #2345 from weaveworks/issues/2344-persist-more
...
Fix ring persistence after free space update
2016-06-09 16:37:57 +01:00
Martynas Pumputis
de2a70861c
Add GET /ipinfo/tracker
...
The endpoint returns the name of tracker. It is used to determine
whether the router is running a tracker.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
9fc7be83c8
Create a Tracker when starting the router
...
The tracker's HandleUpdate method is called by the ring update routines.
In addition, we add a dummy overlay for AWSVPC to make `weave (status|
report)` to produce reasonable reports which includes AWS hosts
connection state.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
c260536429
Add AWSVPC Tracker
...
The tracker is responsible for managing the AWSVPC route tables
which is used to implement the underlay routing based on VPC.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
59b3a3c8c5
Add the Tracker interface
...
An instance of the interface must implement the HandleUpdate method
which (in the future) will be called when any change to the IPAM ring
occurs.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
49f2e208c3
Make ClaimForPeers to claim CIDR-aligned ranges
2016-06-08 16:44:54 +01:00
Bryan Boreham
d1bba977f3
Don't stop reporting free space at the first unchanged range
2016-06-08 11:53:35 +01:00
Bryan Boreham
e2bee6e8c6
Persist ring after updates caused by reportFreeSpace()
2016-06-08 11:52:38 +01:00
Bryan Boreham
1d91c1a23b
Cleanup: change ring test from 255 to 256 in length, which is more realistic
2016-06-01 17:51:21 +01:00
Martynas Pumputis
f50fbc002e
Change ipam Universe from Range to CIDR
...
There was no code to initialize it as anything else, and this lets us
bake in an assumption that it will always be a CIDR.
2016-06-01 17:06:31 +01:00
Adam Harrison
f02b78ed73
Merge branch '1.5'
...
Closes #2282
2016-05-26 16:16:54 +01:00
Bryan Boreham
cda1084777
Check validity of IP subnets
...
Be more consistent about this - check in the same way whether at startup
or during allocation.
2016-05-26 14:31:17 +00:00
Martynas Pumputis
85cea672d3
Change the type of entry.Free to address.Count
...
This change is backward compatible, because the underlying types of
address.Offset (the previous type) and address.Count are the same
and the Gob encoder does not require types to exactly correspond.
2016-05-16 15:03:05 +01:00
Bryan Boreham
d551b6b0a8
Review feedback
2016-05-13 16:27:28 +01:00
Bryan Boreham
1ec2c0fb3f
Use a CIDR-aligned CIDR in unit tests
2016-05-13 16:27:28 +01:00
Bryan Boreham
64dc7a1f69
Donate power-of-2-aligned ranges instead of just slicing at the mid-point.
...
Also fix up space tests to match.
2016-05-13 16:27:28 +01:00
Martynas Pumputis
178438c470
Merge branch '1.5'
2016-05-10 17:36:56 +01:00