Commit Graph

1134 Commits

Author SHA1 Message Date
3e9177d587 Add coverage on pkg/archive
Add tests on:
- changes.go
- archive.go
- wrap.go

Should fix #11603 as the coverage is now 81.2% on the ``pkg/archive``
package. There is still room for improvement though :).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c21d408ad24cf8e2b5bd761d562fae7e3ae1bc54
Component: engine
2015-04-24 17:03:33 +02:00
249f3df46c Merge pull request #9397 from jpopelka/9395-firewalld
Firewalld support
Upstream-commit: 259effc6dfd901130ca6d2926090bddfe35f7cdc
Component: engine
2015-04-23 16:58:08 -04:00
f01047d748 Merge pull request #12543 from vdemeester/11584-pkg-stdcopy-test-coverage
Add some stdcopy_test (coverage)
Upstream-commit: 60ad23a7b3ea6a06cd8ded165ebaab5fd0cc3bd9
Component: engine
2015-04-22 22:03:15 -04:00
3a0cec3089 remove redundant warning
And warning is not supposed to have a prefix WARNING.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: f3dc35169780e1555b4116986649b729cb80b5d1
Component: engine
2015-04-22 08:15:00 +08:00
cff18dc122 Merge pull request #10736 from coolljt0725/add_cpu_limit
Add support cpu cfs_quota
Upstream-commit: 17d5450bc31e81c22e8ccba806294e4d744af275
Component: engine
2015-04-20 17:55:01 -07:00
df94aca214 Merge pull request #12566 from fntlnz/remove-go1.3.3-support
Removed go1.3.3 support
Upstream-commit: e1fd7e25de4574b78cce41becd8ee50bdff23f0c
Component: engine
2015-04-20 17:01:57 -07:00
6f3bec0db9 Merge pull request #12471 from coolljt0725/fix_weird_output_format
Fix weird terminal output format
Upstream-commit: df217120cdc2336181eb3c97fea5acd18ede4ed0
Component: engine
2015-04-20 17:01:02 -07:00
88e80730cf Removed go1.3.3 support
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
Upstream-commit: 92849fdcce257dfd61a5c95f57cde085ff22b431
Component: engine
2015-04-20 23:09:08 +02:00
17684bee7e Add some stdcopy_test (coverage)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2ed4ed50be3a0379d83b9267f62c4c7f665b849f
Component: engine
2015-04-20 22:58:22 +02:00
6f3b598444 Merge pull request #12453 from runcom/style-minor-fixes
Add minor stylistic fixes
Upstream-commit: a7690076c955d242b4590fcf557f15e1029d0c8b
Component: engine
2015-04-20 11:51:04 -07:00
f8f4bcdb38 Add support cpu cfs quota
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: dcc50e1d593fd7995189872791c6d7a013f16970
Component: engine
2015-04-20 08:16:47 -07:00
2e27fa9e39 Make API server datastructure
Added daemon field to it, will use it later for acces to daemon from
handlers

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: d9ed3165228b60cb89c31d0d66b99e01ab83eb3e
Component: engine
2015-04-20 08:13:39 -07:00
1b462401fc Firewalld tests
Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: 379773905c7ff4db3c16e2235f831a9552b4e158
Component: engine
2015-04-20 13:02:09 +02:00
fcda625311 React to firewalld's reload/restart
When firewalld (or iptables service) restarts/reloads,
all previously added docker firewall rules are flushed.

With firewalld we can react to its Reloaded() [1]
D-Bus signal and recreate the firewall rules.
Also when firewalld gets restarted (stopped & started)
we can catch the NameOwnerChanged signal [2].
To specify which signals we want to react to we use AddMatch [3].

Libvirt has been doing this for quite a long time now.

Docker changes firewall rules on basically 3 places.
1) daemon/networkdriver/portmapper/mapper.go - port mappings
   Portmapper fortunatelly keeps list of mapped ports,
   so we can easily recreate firewall rules on firewalld restart/reload
   New ReMapAll() function does that
2) daemon/networkdriver/bridge/driver.go
   When setting a bridge, basic firewall rules are created.
   This is done at once during start, it's parametrized and nowhere
   tracked so how can one know what and how to set it again when
   there's been firewalld restart/reload ?
   The only solution that came to my mind is using of closures [4],
   i.e. I keep list of references to closures (anonymous functions
   together with a referencing environment) and when there's firewalld
   restart/reload I re-call them in the same order.
3) links/links.go - linking containers
   Link is added in Enable() and removed in Disable().
   In Enable() we add a callback function, which creates the link,
   that's OK so far.
   It'd be ideal if we could remove the same function from
   the list in Disable(). Unfortunatelly that's not possible AFAICT,
   because we don't know the reference to that function
   at that moment, so we can only add a reference to function,
   which removes the link. That means that after creating and
   removing a link there are 2 functions in the list,
   one adding and one removing the link and after
   firewalld restart/reload both are called.
   It works, but it's far from ideal.

[1] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.Signals.Reloaded
[2] http://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-name-owner-changed
[3] http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
[4] https://en.wikipedia.org/wiki/Closure_%28computer_programming%29

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: b052827e025267336f0d426df44ec536745821f8
Component: engine
2015-04-20 13:02:09 +02:00
8f2bd21917 Support for Firewalld
Firewalld [1] is a firewall managing daemon with D-Bus interface.

What sort of problem are we trying to solve with this ?

Firewalld internally also executes iptables/ip6tables to change firewall settings.
It might happen on systems where both docker and firewalld are running
concurrently, that both of them try to call iptables at the same time.
The result is that the second one fails because the first one is holding a xtables lock.
One workaround is to use --wait/-w option in both
docker & firewalld when calling iptables.
It's already been done in both upstreams:
b315c380f4
b3b451d6f8
But it'd still be better if docker used firewalld when it's running.

Other problem the firewalld support would solve is that
iptables/firewalld service's restart flushes all firewall rules
previously added by docker.
See next patch for possible solution.

This patch utilizes firewalld's D-Bus interface.
If firewalld is running, we call direct.passthrough() [2] method instead
of executing iptables directly.
direct.passthrough() takes the same arguments as iptables tool itself
and passes them through to iptables tool.
It might be better to use other methods, like direct.addChain and
direct.addRule [3] so it'd be more intergrated with firewalld, but
that'd make the patch much bigger.
If firewalld is not running, everything works as before.

[1] http://www.firewalld.org/
[2] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.passthrough
[3] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.addChain
    https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.addRule

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: 8301dcc6d702a97feeb968ee79ae381fd8a4997a
Component: engine
2015-04-20 13:02:03 +02:00
9132395dda Merge pull request #12438 from ourcolorfuldays/fixtypo
fix some typos
Upstream-commit: c158cdbe6f33667a49615c8ba1ff8e33e71d2228
Component: engine
2015-04-18 07:17:55 -04:00
1e6d2d1fcb fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
Upstream-commit: 70f1910a8bbeb3727829070a2454a636a91e2d48
Component: engine
2015-04-17 08:12:13 +00:00
d17462b4c8 Fix weird terminal output format
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 05a8de46853f8b3534ca6d0cb03121ae214e8a34
Component: engine
2015-04-17 15:28:12 +08:00
47592700e5 Add minor stylistic fixes
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 1c89c6ea2f34f51a05215279c9cdefca30bb13b1
Component: engine
2015-04-16 21:22:32 +02:00
0d7f000ebe added documentation for functions
Signed-off-by: Jason Smith <jasonrichardsmith@gmail.com>
Upstream-commit: dc104ccb40b66a89611f11737d78a2ad31102427
Component: engine
2015-04-15 19:28:01 -07:00
72f22eceb7 Merge pull request #12369 from runcom/fix-links-graph-ref
Fix wrong graphdb refs paths purging
Upstream-commit: 5b048ab2f2aea807033eba7a0ac078303c050826
Component: engine
2015-04-15 11:34:58 -07:00
292892934d Merge pull request #12360 from yestin/11601-supplement-tests-part-2
Improve test accuracy for pkg/chrootarchive (part 2)
Upstream-commit: da697dbed6143761f585b3b2a35c6ef0b501dea8
Component: engine
2015-04-14 21:00:12 -04:00
0046932ffa Fix wrong graphdb refs paths purging
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 088e69da35525fdf380ae73046d999332ea977fa
Component: engine
2015-04-14 23:10:43 +02:00
4f2dd32821 Merge pull request #12214 from ahmetalpbalkan/namesgenerator/localrand
names-generator: use local random instance
Upstream-commit: 040176f6e17d6c1cc2468377b57a8b61d101123c
Component: engine
2015-04-14 13:10:26 -04:00
61e32357e7 Merge pull request #12374 from kostickm/12343-fix-vet-warning-archive
Fix vet warning in archive.go
Upstream-commit: 7b29a88146466a104a0bccfea8f1e7338ed18cc2
Component: engine
2015-04-14 10:06:04 -07:00
8b7d236741 Fix vet warning in archive.go
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
Upstream-commit: fc20658a01e362a5bb484b439a0a1004c51f9ff5
Component: engine
2015-04-14 09:13:50 -07:00
c4d568bf1b Improve test accuracy for pkg/chrootarchive (part 2)
Check test correctness of untar by comparing destination with
source. For part 2, it checkes hashes of source and destination
files or the target files of symbolic links.

This is a supplement to the #11601 fix.

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
Upstream-commit: 67df8e4257c165bc6abe77bb8f4ab55c10b2fbff
Component: engine
2015-04-13 21:46:14 -07:00
e458801862 names-generator: use local random instance
Instead of seeding/polluting the global random instance,
creating a local `rand.Random` instance which provides the same
level of randomness.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 25fab69f7dcf72dabfeb60f61f50f175692f0b03
Component: engine
2015-04-14 02:35:16 +00:00
a4111cba55 Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c30a55f14dbbe3971ba0ac716ba69a60868f4490
Component: engine
2015-04-14 01:37:36 +02:00
d6a743bd91 Merge pull request #12044 from reteptilian/11721-remove-randomstring-3
fixes 11721 replace stringutils.GenerateRandomString with stringid.GenerateRandomID
Upstream-commit: b5c3d01e6b5d06ba3e477a71acf92ec564b279e6
Component: engine
2015-04-13 13:47:50 -07:00
c70c4ed8f3 Merge pull request #12204 from yestin/11601-supplement-tests-part-1
Improve test accuracy for pkg/chrootarchive (part 1)
Upstream-commit: b6e64981e655d1c0cdd3778d4d9fad0caca6e08a
Component: engine
2015-04-13 16:14:18 -04:00
31603a5780 Merge pull request #12342 from LK4D4/fix_vet_warn
Fix vet warning
Upstream-commit: afd973c4971ee2bed4c943cf08d6e7ef19dd8501
Component: engine
2015-04-13 12:56:47 -07:00
6d9355e11c Merge pull request #12276 from estesp/10246-really-fix-arg-list
Send archive options via pipe in chrootarchive
Upstream-commit: 9e0a55b48c019d0ca61e3f74d3b41f621f16ab48
Component: engine
2015-04-13 14:44:47 -04:00
710e6abbd8 Fix vet warning
pkg/archive/archive_test.go:496: arg changes for printf verb %s of wrong type: []archive.Change

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 213eab995a3e6dcdb69b587301cc5008911e3dfe
Component: engine
2015-04-13 11:43:30 -07:00
e7ca25cd17 Merge pull request #12297 from vdemeester/11603-pkg-archive-test-coverage
Add test on archive.go (#11603)
Upstream-commit: 5a174e5def446e2ea299aed3ebd41f8b949534ad
Component: engine
2015-04-13 10:54:21 -07:00
34cad7f622 correct pkg/stdcopy NewStdWriter function comments
pkg/stdcopy NewStdWriter function has wrong doc comment,
utils is not correct, it should be stdcopy

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
Upstream-commit: a715b0e31beabed9ac5702af2ede619b4232cbdb
Component: engine
2015-04-13 17:21:27 +08:00
99fe2c5b3a Send archive options via pipe in chrootarchive
After finding our initial thinking on env. space versus arg list space
was wrong, we need to solve this by using a pipe between the caller and
child to marshall the (potentially very large) options array to the
archiver.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 908db51804635ce002e97e4efb867f7352204f8e
Component: engine
2015-04-12 21:16:54 -04:00
2f631c4832 Add test on archive.go (#11603)
- Trying to add or complete unit test to each ``func``
- Removing dead code (``escapeName``)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c4fe5dad1deb45ecde460d7627523dbf032dc205
Component: engine
2015-04-11 23:21:37 +02:00
6607181ac9 Turned off Ctrl+C processing by Windows shell
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
Upstream-commit: c337bfd2e0b0293dbca478a13c29a469493782eb
Component: engine
2015-04-10 15:43:35 -07:00
5f1006335a Merge pull request #12238 from brendandixon/win-cli/fixes
Corrected int16 overflow and buffer sizes
Upstream-commit: 43aca9adac732f32bb04cc435a1bb58521fd9984
Component: engine
2015-04-10 13:36:23 -04:00
d243477d0e Remove pools_nopool.go & build tag from pools.go
Fix #11576

Signed-off-by: Gleb Shepelev <shepelyov.g@gmail.com>
Upstream-commit: f01d755cd0af7b17596cc084871f7f032995cac3
Component: engine
2015-04-10 02:32:55 +03:00
aff5e53ec8 Corrected int16 overflow and buffer sizes
Signed-off-by: Brendan Dixon <brendand@microsoft.com>
Upstream-commit: a264e1e83debfaefcb99f5554b8eda9c088a09d1
Component: engine
2015-04-09 09:03:04 -07:00
2be71420a6 namesgenerator: Proposing Kilby/Noyce
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 197ec4a6377373b4a0c2eaf90c9fde9cede2074b
Component: engine
2015-04-09 04:11:06 -07:00
866fb761f9 Improve test accuracy for pkg/chrootarchive (part 1)
Check test correctness of untar by comparing destination with
source. For part one, it only compares the directories.

This is a supplement to the #11601 fix.

Signed-off-by: Yestin Sun <yestin.sun@polyera.com>
Upstream-commit: 7bb4b055abab5f5b561a970f7235c2d113a4d85f
Component: engine
2015-04-08 14:07:31 -07:00
7eb558ca75 Proposing Seymour Cray
Signed-off-by: Chris Stivers <chris@stivers.us>
Upstream-commit: 5206f76f44f3a55e52d3c0878b0ec780484595c0
Component: engine
2015-04-08 13:17:22 -07:00
ca7b99332a Merge pull request #11909 from runcom/11908-refactor-utils-utils-daemon
Refactor utils/utils_daemon
Upstream-commit: ebd7df3bbeb9486d13119178810a1ddabfd6d04d
Component: engine
2015-04-07 13:24:24 -07:00
37758aba7d Merge pull request #12033 from rhvgoyal/devmapper-cleanup
Devmapper Graph Driver Misc cleanup
Upstream-commit: 86d66d62737aa090b4a703ce0bfe3df0f9669a6b
Component: engine
2015-04-07 15:49:32 -04:00
02aa86f034 Swap width/height in GetWinsize and monitorTtySize
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 6e44246fed43341938a41c6db9b115e1e64d332a
Component: engine
2015-04-06 14:31:42 -07:00
bdfc59cfb7 Windows console fixes
Corrected integer size passed to Windows
Corrected DisableEcho / SetRawTerminal to not modify state
Cleaned up and made routines more idiomatic
Corrected raw mode state bits
Removed duplicate IsTerminal
Corrected off-by-one error
Minor idiomatic change

Signed-off-by: Brendan Dixon <brendand@microsoft.com>
Upstream-commit: 1a36a113d4afc11151c80b111d7357b7c31be32b
Component: engine
2015-04-03 15:02:52 -07:00
d1ddfb9a9a Merge pull request #11886 from jamiehannaford/pkg-mnt-docs
Document exported functions and consts in pkg/mount
Upstream-commit: 9cdad8a26b4af14680c4bcb25feea854536a323b
Component: engine
2015-04-03 21:28:11 +00:00