Commit Graph
54 Commits
Author SHA1 Message Date
Bryan Boreham dcce09de52 Clean up some code-review issues 2014-10-20 14:21:29 +01:00
Bryan Boreham 8e2af9eec5 Tidy up exported/non-exported fields 2014-10-20 12:41:40 +01:00
Michael Bridgen a3cede3027 Tidied up a few printfs 2014-10-17 15:24:51 +01:00
Michael Bridgen 0749460652 Moved updater into server
While we're only reacting to containers going away, it's more
convenient to bundle the docker events watcher into the server.

I've added a flag to switch it on; and switched it on by default in
the container.

I also implemented `Zone.DeleteRecordsFor(ident)`, which removes all
records for a particular container.

One minor change to the structure of the code is that the Zone is now
constructed *outside* the server, and given to it and the updater.
2014-10-16 15:38:32 +01:00
Bryan Boreham 6e3e7dcd68 Support DELETE function 2014-10-14 17:01:13 +01:00
Bryan Boreham 11ec66111a Check duplicate add 2014-10-14 17:00:14 +01:00
Bryan Boreham 4709f852c3 Better error reporting 2014-10-14 16:59:00 +01:00
Bryan Boreham 6d32ac80b7 Better error reporting 2014-10-14 16:50:20 +01:00
Bryan Boreham ff540265a9 Better error-checking 2014-10-14 16:49:27 +01:00
Bryan Boreham 10772f8289 Better error-checking 2014-10-14 16:12:50 +01:00
Bryan Boreham bc87c7c94b Initial Zone tests 2014-10-14 16:06:25 +01:00
Bryan Boreham 8ebc06315c Detect duplicate add 2014-10-14 16:06:08 +01:00
Bryan Boreham 9bd464a003 Make putForm more generic 2014-10-14 15:23:20 +01:00
Bryan Boreham 7f6e0a1e42 Make error message more helpful 2014-10-14 15:19:20 +01:00
Bryan Boreham 36fa3cca73 Tidy up 2014-10-14 14:12:42 +01:00
Bryan Boreham 6bff651e87 Changed to new URL scheme with container identifier
Implementation matches design.md better:
 - http action changes from POST /add to PUT /name
 - each record now has the container identifier
2014-10-14 11:55:45 +01:00
Bryan Boreham 50d343e2fb Use specified port for http listener 2014-10-10 17:36:46 +01:00
Bryan Boreham 03cd04249c Check number of results received 2014-10-10 17:36:23 +01:00
Bryan Boreham be3d089410 Shorten mDNS timeout 2014-10-10 17:14:39 +01:00
Bryan Boreham ed6c7cb784 Concatenate multiple replies received over mDNS 2014-10-10 17:14:06 +01:00
Bryan Boreham 8521fdea0e Reply with array of addresses for delegated query 2014-10-10 16:31:09 +01:00
Bryan Boreham b5214f65e7 Forward DNS requests that aren't for our 'weave' domain 2014-10-10 15:41:09 +01:00
Bryan Boreham de65dc7996 Move usage of mdnsClient after initialization 2014-10-10 15:34:54 +01:00
Michael Bridgen b1b75c4a8a Moved the server startup code out of main.go 2014-10-10 11:53:21 +01:00
Bryan Boreham 65e95cd46a Factor out channel 2014-10-09 14:46:53 +01:00
Bryan Boreham 17d192caee Add test for two parallel queries 2014-10-09 14:15:02 +01:00
Bryan Boreham 5b32fa58e6 factor out response checking 2014-10-09 14:11:16 +01:00
Bryan Boreham d41284f66d Refactor test setup 2014-10-09 13:08:58 +01:00
Bryan Boreham 0f8932fbcd Add test for name that we don't know 2014-10-08 17:16:57 +01:00
Bryan Boreham 64e9121e5b Simple test of http function 2014-10-08 17:00:41 +01:00
Bryan Boreham eec53d6c4d Test failure condition 2014-10-08 15:20:12 +01:00
Bryan Boreham 97077339f4 Send back errors for SendQuery 2014-10-08 15:19:30 +01:00
Bryan Boreham 8295ecfe46 Shut down listener when test finished 2014-10-08 14:46:10 +01:00
Bryan Boreham f30ecb4a48 MDNS Server test 2014-10-08 14:40:38 +01:00
Bryan Boreham 6fc817104e Shut down client when test finished 2014-10-08 14:40:18 +01:00
Bryan Boreham 3175e64b63 Shut down multicast listener when client is shut down 2014-10-08 14:24:29 +01:00
Bryan Boreham de94b06e89 Wait for response synchronously 2014-10-08 14:19:31 +01:00
Bryan Boreham 6a60b7b628 Don't need multiplexer 2014-10-08 14:16:13 +01:00
Bryan Boreham 6a9e0bb23f Shut down minimal server at end of test 2014-10-08 14:14:10 +01:00
Bryan Boreham dbc77b2943 Don't crash on nil (default) interface 2014-10-08 14:13:05 +01:00
Bryan Boreham 6506b63520 Removed IsInflightQuery that is done by IP address now 2014-10-08 13:49:20 +01:00
Bryan Boreham d234fe9506 Move handleMDNS into server file 2014-10-08 12:31:20 +01:00
Bryan Boreham 37924f9f9b Refactor into separate client and server classes 2014-10-08 11:30:42 +01:00
Bryan Boreham 9ec95e4fa8 Unit test 2014-10-07 16:29:58 +01:00
Bryan Boreham 930a6ff939 Remove log message 2014-10-07 16:29:17 +01:00
Bryan Boreham 8feddc96ed Merge remote-tracking branch 'upstream/master' 2014-10-07 13:18:34 +01:00
Michael Bridgen e8e86dadc0 Changed to accept a CIDR address and use net.IP
* In general we'll have an IP address and a subnet mask for the weave
   network address; account for this in the zone DB and in the HTTP
   server.

 * Use the net.IP type rather than string, which gives us a bit more
   generality (in theory it'll deal with Ipv6 too) and validation (we
   attempt to parse the input)
2014-10-07 12:49:52 +01:00
Bryan Boreham a545d2738c Move timeout to incoming queries 2014-10-07 12:47:18 +01:00
Bryan Boreham 2cab8415f2 Tidy up slightly 2014-10-07 12:10:19 +01:00
Bryan Boreham a78766524b Time out mDNS queries 2014-10-07 11:48:56 +01:00