Commit Graph

106 Commits

Author SHA1 Message Date
0c091d906f Remove jobs from daemon/networkdriver/bridge
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 53582321ee502335a9c3be4789bef984e09f77c4
Component: engine
2015-04-08 18:50:29 -04:00
00cc5b6eeb Remove "stupid" wording
Signed-off-by: José Tomás Albornoz <jojo@eljojo.net>
Upstream-commit: 4cf5a1c2aa2f95a0bca5a0bf47026518b7b2167f
Component: engine
2015-04-04 15:26:45 +02:00
7f060d0ed1 Initialize portMapper in RequestPort too
Api requesting port for daemon before init_networkdriver called.
Problem is that now initialization of api depends on initialization of
daemon and their intializations runs in parallel. Proper fix will be
just do it sequentially. For now I don't want refactor it, because it
can bring additional problems in 1.6.0.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 584180fce7ad11516a256b8abd4621138337e918
Component: engine
2015-03-31 11:30:57 -07:00
45221d6bfb Ensure that bridge driver does not use global mappers
This has a few hacks in it but it ensures that the bridge driver does
not use global state in the mappers, atleast as much as possible at this
point without further refactoring.  Some of the exported fields are
hacks to handle the daemon port mapping but this results in a much
cleaner approach and completely remove the global state from the mapper
and allocator.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: d8c628cf082a50c0a2a5e381a21da8279a5462b4
Component: engine
2015-03-30 18:28:24 -07:00
cbb7d427c6 Refactor portmapper to remove ALL global state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 62522c98539e1591017cf0d4f28e6a58f3b1ec6b
Component: engine
2015-03-30 17:31:21 -07:00
163fcc5bfd Refactor port allocator to not have ANY global state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 43a50b06187e324e43b26003cace0f351a5fb78c
Component: engine
2015-03-30 17:30:59 -07:00
8b07e2892d Fix a typo in daemon/networkdriver/ipallocator/allocator.go
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: 08331294bcabf90ce3d22dca729f206912d2a752
Component: engine
2015-03-30 08:31:46 +08:00
1c9316a817 Merge pull request #11788 from reikani/pchoi
Changed snake case naming to camelCase.
Upstream-commit: da5c863d20df8c030b3ffc6c4e95f976ed162721
Component: engine
2015-03-26 23:55:50 -07:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
a16f3d6cb4 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c79b9bab541673af121d829ebc3b29ff1b01efa2
Component: engine
2015-03-25 22:32:08 +01:00
558349d8ce Merge pull request #11689 from calavera/ipallocator_refactor
Use a structure to keep the allocated ips pool.
Upstream-commit: f7900cdd67e71a418d3cbfeb1b23315c5be78bdf
Component: engine
2015-03-24 12:42:30 -07:00
0185f15317 Use a structure to keep the allocated ips pool.
Fixes #11624.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 7e95b13460a58db75630d2d795482f39c68762c2
Component: engine
2015-03-24 11:41:44 -07:00
8938696741 Refactor global portallocator and portmapper state
Continuation of: #11660, working on issue #11626.

Wrapped portmapper global state into a struct. Now portallocator and
portmapper have no global state (except configuration, and a default
instance).

Unfortunately, removing the global default instances will break
```api/server/server.go:1539```, and ```daemon/daemon.go:832```, which
both call the global portallocator directly. Fixing that would be a much
bigger change, so for now, have postponed that.

Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
Upstream-commit: 87df5ab41b3f9b2bdd8682f4afd41dac78f7e96d
Component: engine
2015-03-24 11:15:30 +00:00
7074731d32 Merge pull request #11636 from robertabbott/refactor_networkfs
Refactor pkg/networkfs
Upstream-commit: d5eea4e8b04074b709d1bbe19b5336504df44446
Component: engine
2015-03-23 16:58:29 -07:00
6be1b45eff Merge pull request #11545 from cpuguy83/remove_allocator_warning
Don't warn when ip_local_port_range not found
Upstream-commit: ccd4181d10752c41603fcc03bb6b576603b24271
Component: engine
2015-03-23 14:19:57 -07:00
4df1193b38 Refactor global portallocator state into a global struct
Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
Upstream-commit: 12576798769081823a3f660b46290da808630616
Component: engine
2015-03-23 20:41:41 +00:00
f2b00f6fe1 Improve err message when parsing kernel port range
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8e4d9f3cf9669f45b0591eea27c47b6f64d89c2d
Component: engine
2015-03-23 13:29:25 -07:00
4b8e196164 Refactor pkg/networkfs
Solves #11591

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: a91b2431a303f919b0737d95639d8e445124cb23
Component: engine
2015-03-22 23:53:47 -07:00
005b71267c [WiP] Adds testing for bridge's IPv6 support
* fixes #10001
* test for global subnets <= 80
* test for global subnets > 80
* test link local allocations
* test duplicated addresses
* test regression from bug #11427

Signed-off-by: Christian Simon <simon@swine.de>
Upstream-commit: 4307ec283b817997bdcf989767a99d57f7361b9f
Component: engine
2015-03-18 08:51:14 +01:00
8da4d5374d Reduce logging level from error to warning if "/proc/sys/net/ipv4/ip_local_port_range" proc file in not accessible.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 39d49ba7ba21f204f5fc174aaf319ed1cdad790f
Component: engine
2015-03-17 17:39:17 +00:00
1820b54f91 Merge pull request #11427 from LK4D4/fix_alloc_ip6
Fix IPv6 autoallocation from mac with --ipv6-cidr
Upstream-commit: 213be9ee2761828f56c7308bd85e4ca9fd33e34a
Component: engine
2015-03-16 16:38:46 -07:00
7a404617a3 Merge pull request #11402 from miminar/err-cleanup
Error formatting cleanups
Upstream-commit: 88f437d6c619f7b07a22cb5750814bce4d8d7164
Component: engine
2015-03-16 16:13:16 -07:00
aeed74c156 Fix IPv6 autoallocation from mac with --ipv6-cidr
We used slice globalIPv6Network.IP itself, not its copy as expected.

Fixes #10774

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 491f8ab14493babb1c06e240c7a9de64f34827a0
Component: engine
2015-03-16 15:36:50 -07:00
2781401caa fix various problems with iptables.Exists
This modifies iptables.Exists so that it must be called with an explicit
table and chain.  This allows us (a) to generate an appropriate command
line for "iptables -C", which was not previously possible, and (b) it
allows us to limit our strings.Contains() search to just the table and
chain in question, preventing erroneous matches against unrelated rules.

Resolves #10781

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
Upstream-commit: 3559b4177e611920d87c4dae607c641efb645783
Component: engine
2015-03-16 17:14:45 -04:00
c29e43cc4b Format error by value
- Use `%v` verb to format errors.
- Give `param` constant in portallocator some better name.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 210ab030bc3dab7bcf8f7252f2f9facb5a26cb6b
Component: engine
2015-03-16 12:05:53 +01:00
dc9421e6d9 Pass buffered file reader to Fscanf instead of string reader
Unless `file` is wrapped with buffered reader, `fmt.Fscanf` will read
just one byte and terminate with `EOF`.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 40d540637168fd5781e0c4a9cbd91959b7407d96
Component: engine
2015-03-13 09:40:53 +01:00
70fb9fcc59 Restructured port range loader
And renamed `GetPortRange` to `PortRange`.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 0dcc970432677ddd13d8ed583de84ae075888228
Component: engine
2015-03-10 10:02:43 +01:00
c40472feb0 Use default port range in unit tests
Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: fcf8e85a35cddfd1f75f652a513015bb6f169257
Component: engine
2015-03-09 16:58:14 +01:00
054ec22a23 Use system's ephemeral port range for port allocation
Read `/proc/sys/net/ipv4/ip_local_port_range` kernel parameter to obtain
ephemeral port range that now sets the boundaries of port allocator
which finds free host ports for those exported by containers.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 0eb3544c43cb8e9488d6bf329ceecc11fa0db6f1
Component: engine
2015-03-09 09:13:20 +01:00
8d2cefd5a5 Seems like an un-necessary if statement
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 4e5ea0c8755231dfffd7b82bc6551415b14ed0de
Component: engine
2015-03-04 13:24:17 -08:00
1e821173bd Just format some logs and notes in /daemon/networkdriver/bridge/driver.go
Signed-off-by: Zen Lin(Zhinan Lin) <linzhinan@huawei.com>
Upstream-commit: 2c0e027ab9b7da131451d571c4d0f25bc5fc14eb
Component: engine
2015-03-03 23:39:04 +08:00
8ce83c8f78 fix err in note at daemon/networkdriver/bridge/driver.go
Signed-off-by: Zen Lin(Zhinan Lin) <linzhinan@huawei.com>
Upstream-commit: e5bc50b5cd5237e820f5a708d0c351581905f1e2
Component: engine
2015-03-03 00:52:53 +08:00
10fe3fe6e5 Merge pull request #10215 from taohu/remove-assumption-first-ip-is-bridge-ip
Remove the assumption that the first IP is the bridge IP
Upstream-commit: ffc499dbabdef0cdfeb5e71b96b445efa6f12c2e
Component: engine
2015-02-06 14:15:46 -08:00
6bb03bfe90 Remove "OMG IPV6" log message
Signed-off-by: Erik Hollensbe <erik+github@hollensbe.org>
Upstream-commit: 8d7683af864be7e8e15442a354653d7a0c0f645b
Component: engine
2015-01-31 13:21:06 -08:00
c59fff945d Fix bridge initialization for IPv6 if IPv4-only docker0 exists
This fixes the daemon's failure to start when setting --ipv6=true for
the first time without deleting `docker0` bridge from a prior use with
only IPv4 addressing.

The addition of the IPv6 bridge address is factored out into a separate
initialization routine which is called even if the bridge exists but no
IPv6 addresses are found.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 0c8d17b5c1a142bc09abe1105d985e76db6f225d
Component: engine
2015-01-27 23:54:26 -05:00
cc1de71aa0 Fix missing err assignment in bridge creation
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Upstream-commit: d5c78a4c07929eda2d448f9b2a09fb3d65a75a2d
Component: engine
2015-01-23 14:48:28 -08:00
557e7b0de2 Remove the assumption that the fist IP is the bridge IP
The assumption is not true if user specifies an IP address other than
the first IP, in that case the first IP address is never allocated to
any container.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Upstream-commit: 8ec6c692dba14b7d95acd2c56e4fd8b020151ce1
Component: engine
2015-01-21 02:13:58 +08:00
146962fdd3 Adding IPv6 network support to docker
Signed-off-by: Malte Janduda <mail@janduda.net>
Upstream-commit: 813ff7f19d6a097f39dae363d8dd81b70eee515a
Component: engine
2015-01-09 00:13:09 +01:00
6aa8095ea3 Remove BridgeIP from ipallocation pool
Closes #9938

Signed-off-by: Malte Janduda <mail@janduda.net>
Upstream-commit: f4551b8a48bdc7a135466398eecfb103fcde25c6
Component: engine
2015-01-08 16:21:09 +01:00
d0893cb64b Tidy driver.go/LinkContainers
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 38a595aec561b8a7b4325b6c1c4efd1b0b8e89c0
Component: engine
2014-12-21 13:42:02 +10:00
4b105a7583 Create tests for pkg/iptables
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 0da92633b4161ed1f8babe5ec4a9fe98257d34b5
Component: engine
2014-12-21 12:57:32 +10:00
ae55b92633 Create DOCKER forward chain on driver init
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 2865373894f1532fa725481e8f04db4a5d7a0aa8
Component: engine
2014-12-21 12:57:32 +10:00
c720d69487 Move per-container forward rules to DOCKER chain
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: cc89b30d35edc02fc598a0b26fe7a1ed002238e4
Component: engine
2014-12-21 12:57:32 +10:00
9254581bd3 Try other port on any error from Map
Sometimes other programs can bind on ports from our range, so we just
skip this ports on allocation.

Fixes #9293
Probably fixes #8714

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a00a1a1fca020d21cb677439160e018bda5c3835
Component: engine
2014-12-01 16:26:30 -08:00
95c96f42c9 Merge pull request #9149 from swagiaal/fix-configureBridge-comment
Remove reference to 'ifaceName' from configureBridge comment.
Upstream-commit: a43ee077dca75d0e8f198275db17eac341b0ca8c
Component: engine
2014-11-21 16:37:28 -05:00
c878d4a442 Apply same typed iptables errors to network driver.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: f6c7194539720473aae814d3d1445eab2a78d568
Component: engine
2014-11-20 18:07:15 -08:00
a47630e4a6 Increase timeout for userland proxy starting
Fixes #8883

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 72c55e82156843c73ab1405b565e63d947b66c10
Component: engine
2014-11-20 09:02:42 -08:00
89f15328f3 Merge pull request #8699 from shuai-z/fix-portalloc
Fix corner cases in ipallocator and portallocator
Upstream-commit: 34cb92e2d49e2c141a67cd5df73a54c1655b2842
Component: engine
2014-11-16 22:10:40 -08:00
9224549fdb Remove reference to 'ifaceName' from configureBridge comment.
The argument ifaceName was removed in a much earlier commit.

Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
Upstream-commit: a01f1e707eb682ec60d489a4171d2c82de79ee57
Component: engine
2014-11-13 10:19:56 -05:00