Commit Graph

9 Commits

Author SHA1 Message Date
Vincent Demeester 421a3ec5d7 Use gofmt with -s instead of goimports
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-02-12 14:07:00 +01:00
Travis Thieman c6dfe4b795 Fix etchosts.Update to not target hosts with given hostname as prefix
Signed-off-by: Travis Thieman <travis.thieman@gmail.com>
2016-01-10 10:58:49 -05:00
Alexander Morozov 36a8f5822c Use simple scanner instead of regexp for etchosts.Delete
Benchmark results:
benchmark           old ns/op     new ns/op     delta
BenchmarkDelete     4315186       2245829       -47.96%

benchmark           old allocs     new allocs     delta
BenchmarkDelete     4645           10             -99.78%

benchmark           old bytes     new bytes     delta
BenchmarkDelete     1590011       4832          -99.70%

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-23 13:36:30 -07:00
Alexander Morozov de7607f509 Add benchmark for etchosts.Delete
Also added more checks to test

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-23 13:36:30 -07:00
Jana Radhakrishnan cdb82dc22d Synchronize /etc/hosts updates at file level
Introduced a path level lock to synchronize updates
to /etc/hosts writes. A path level cache is maintained
to only synchronize only at the file level.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-21 07:45:29 -07:00
David Calavera cc02894a50 Move test specific functions to a testutils package.
This way we won't vendor test related functions in docker anymore.
It also moves netns related functions to a new ns package to be able to
call the ns init function in tests. I think this also helps with the
overall package isolation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 13:33:28 -04:00
Jana Radhakrishnan 28c2445dad Do not update /etc/hosts for empty endpoints
There is no need to update the /etc/hosts files
of containers for endpoints which are created/deleted
in a network whose interface list is empty

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-24 12:09:44 -07:00
Jana Radhakrishnan 362568467d Add/Delete etc hosts record support
Currently the etchosts package only provides helpers
to completely build an /etc/hosts file from scratch
or update a single hostname's IP address to a different
one. This commit adds the ability to add/delete an arbitrary
number of host record entries to/from the etc hosts file

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-19 00:40:27 -07:00
Alessandro Boch f16db2c3ad Remove pkg directory
- As recommended by Docker committers.
- Will introduce internal directory when go supports it

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-16 16:12:13 -07:00