Commit Graph

762 Commits

Author SHA1 Message Date
Michael Crosby 122573a738 Merge pull request #219 from harshavardhana/xattr_build
xattr: Disallow build on non linux platforms
2014-10-15 15:39:56 -07:00
Ian Main d67a27ee13 Create an ApplyDevices call.
For our work on adding dynamic device support to Docker we needed to be
able to call this to update the list of allowed devices.  This works for
both systemd and fs based cgroups implementations.

Co-Authored-By: Chris Alfonso <calfonso@redhat.com> (github: calfonso)
Docker-DCO-1.1-Signed-off-by: Ian Main <imain@redhat.com> (github: imain)
2014-10-15 11:59:26 -07:00
Harshavardhana e3d305c1ef xattr: Disallow build on non linux platforms
Signed-off-by: Harshavardhana <fharshav@redhat.com>
2014-10-15 01:06:47 -07:00
Michael Crosby 8d1d0ba38a Merge pull request #224 from crosbymichael/set-apparmor-execin
Set apparmor profile in execin
2014-10-13 23:23:12 -07:00
Michael Crosby cb6ba4dbfb Set apparmor profile in execin
The set of the apparmor profile for the setns codepath was missing.
Selinux was being called but apparmor was forgotten.  This was causing
no profiles to be applied to the extra process spawn inside an existing
container.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-14 05:53:44 +00:00
Michael Crosby 4f409628d8 Merge pull request #222 from rhatdan/exec
Do not check if SELinux is enabled on lowlevel calls to set processlabel
2014-10-13 12:52:01 -07:00
Dan Walsh 7f60c92d65 Do not check if SELinux is enabled on lowlevel calls to set processlabel
docker exec changes the mount namespace which fools selinux bindings
into thinking SELinux is disabled.  Bindings should just check if
a label is passed in and attempt to use it.  Docker will not call these
functions with a label if SELinux is disabled.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-10-11 06:04:52 -04:00
Ye Yin 4ca4048d98 Adds a tx_queuelen setting for veth in the network configuration and defaults it to 0.
Signed-off-by: Ye Yin <hustcat@gmail.com>
2014-10-10 13:29:46 -04:00
Victor Marmol f4254672e6 Merge pull request #216 from cbosdo/master
cgroups: Export ParseCgroupFile
2014-10-08 10:51:49 +02:00
Alexander Larsson 06949e779f pkg/cgroups: Export ParseCgroupFile
This is needed for the libvirt exec driver.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
2014-10-07 15:55:58 +02:00
Michael Crosby 2dce757d21 Merge pull request #213 from tianon/crosbymichael_test.go
Fix "go install -v . ./.git/logs/refs/heads ./.git/refs/heads ..."
2014-10-03 11:06:24 -07:00
Tianon Gravi 49da8a49fa Fix "go install -v . ./.git/logs/refs/heads ./.git/refs/heads ..."
This happens when you name a git object (branch, tag, etc) `something_test.go`.

Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-10-02 16:19:56 -06:00
Victor Marmol b3570267c7 Merge pull request #212 from crosbymichael/veth-naming
Add more entropy to veth pair creation
2014-10-02 15:11:47 -07:00
Michael Crosby b9d08491f6 Add loop for veth pair creation on ErrInterfaceExists
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-02 22:03:25 +00:00
Michael Crosby 255989b835 Introduce more entropy in veth name generation
The current 4 chars are not enough, bumped to 7

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-02 21:56:48 +00:00
Mrunal Patel 12845ae8aa Merge pull request #202 from harshavardhana/xattr_list_xattr
Update system/xattrs_linux.go
2014-10-01 17:28:05 -07:00
Harshavardhana 5dca16dcb8 xattr/xattr.go: Add new higher level helpers for xattr
Signed-off-by: Harshavardhana <fharshav@redhat.com>
2014-10-01 17:24:03 -07:00
Harshavardhana 6224908d4e Update system/xattrs_linux.go
- Add Llistxattr() support
- Additionally cleanup Lgetxattr() and implement it properly
  in accordance with getxattr() syscall behavior.

Signed-off-by: Harshavardhana <fharshav@redhat.com>
2014-10-01 17:24:03 -07:00
Victor Marmol 0a5fde25c5 Merge pull request #208 from MalteJ/master
Expose parameter to set interface MAC address
2014-09-30 08:27:47 -07:00
Malte Janduda d804790e8d MACAddress -> MacAddress
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-30 00:33:12 +02:00
Malte Janduda bf54bdfd7f implementing SetInterfaceMac
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-29 23:55:47 +02:00
Mrunal Patel c744f6470e Merge pull request #206 from milosgajdos83/vlan-macvlan
Added support for VLAN and MAC VLAN interfaces plus did a bit of refactoring.
2014-09-29 13:22:49 -07:00
Milos Gajdos d90daa0cf7 Added VLAN and MAC VLAN device support to netlink
You can now create VLAN and MAC VLAN devices using netlink.
I've also added tests for both VLAN and MAC VLAN stuff.

Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com> (github: milosgajdos83)
2014-09-27 04:15:34 +01:00
Milos Gajdos 267ba8f753 Refactored SetNs funcs. Implemented ChangeName.
I've refactored NetworkSetNsPid and NetworkSetNsFd following
what we already have in place for Add/Del Ip and Add/Del Link.
I've reimplemented NetworkChangeName function which is now
using netlink for changing the interface name. I added tests too.
I've moved the original syscall implementation at the bottom
to keep it together with the other non-netlink functions.

Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com> (github: milosgajdos83)
2014-09-27 02:27:32 +01:00
Victor Marmol 30e50af760 Merge pull request #205 from hugoduncan/fix-leaking-fd-in-netns
Fix leaking file descriptor in NetNs strategy
2014-09-25 13:23:10 -07:00
Hugo Duncan 52f4743aba Fix leaking file descriptor in NetNs strategy
Docker-DCO-1.1-Signed-off-by: Hugo Duncan <hugo@hugoduncan.org> (github: hugoduncan)
2014-09-25 14:05:24 -04:00
Victor Marmol 605edd6394 Merge pull request #203 from MalteJ/master
Adding IPv6 network support
2014-09-25 08:29:06 -07:00
Malte Janduda 4a14248dc8 Address6 -> IPv6Address and Gateway6 -> IPv6Gateway
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-24 20:48:00 +02:00
Mrunal Patel 0da391f51c Merge pull request #201 from vishh/stats_rounding
Saturate negative memory stat values at '0'.
2014-09-24 10:35:53 -07:00
Vishnu Kannan 4bfda8a764 Saturate negative memory stat values at '0'.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-09-24 16:47:41 +00:00
Malte Janduda dd9e42732e Adding IPv6 network support
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-24 11:36:40 +02:00
Michael Crosby 40f1336057 Merge pull request #199 from SaiedKazemi/rootfs
Add RootFs field to configuration options in libcontainer's Config
2014-09-23 16:49:04 -07:00
Saied Kazemi bbd2b4cbff Merge branch 'rootfs' of https://github.com/SaiedKazemi/libcontainer into rootfs
Conflicts:
	namespaces/exec.go
2014-09-23 16:18:48 -07:00
Saied Kazemi ae81ea069f Add RootFs field to configuration options in libcontainer's Config
Since currently the container.json file does not include the pathname
to a container's root filesystem, we need to parse /proc/mounts which
is slow and error-prone.  This patch addresses this issue by adding a
new RootFs field.

Signed-off-by: Saied Kazemi <saied@google.com>
2014-09-23 16:16:13 -07:00
Saied Kazemi e4a4af4bfe Add RootFs field to configuration options in libcontainer's Config
Since currently the container.json file does not include the pathname
to a container's root filesystem, we need to parse /proc/mounts which
is slow and error-prone.  This patch addresses this issue by adding a
new RootFs field.

Signed-off-by: Saied Kazemi <saied@google.com>
2014-09-23 14:04:55 -07:00
Victor Marmol 930cdd82c9 Merge pull request #197 from milosgajdos83/netlink-tests
Refactored and added more tests.Cleaned up netlink a bit.
2014-09-22 15:52:21 -07:00
Milos Gajdos 63cfaa86b3 Fixing Travis builds by allowing short tests.
Docker-DCO-1.1-Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com> (github: milosgajdos83)
2014-09-20 03:36:08 +01:00
Milos Gajdos 4fe2c7a4db Refactored and added more tests.Cleaned up netlink.
I've added more tests. We now have almost 55% coverage.
I've also reorganized netlink_linux codebase and moved
the non-RTNETLINK functions at the bottom. I've also
added some comments to some functions.

Docker-DCO-1.1-Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com> (github: milosgajdos83)
2014-09-20 03:11:26 +01:00
Michael Crosby 185328a426 Merge pull request #194 from lmars/netlink-set-mac-addr
netlink: Add NetworkSetMacAddress
2014-09-19 11:18:51 -07:00
Lewis Marshall 80a574ab49 netlink: Add NetworkSetMacAddress
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2014-09-18 02:15:32 +01:00
Michael Crosby e1d882b523 Merge pull request #192 from titanous/netlink-cleanup
netlink: Add uint32Attr helper
2014-09-16 10:56:33 -07:00
Jonathan Rudenberg 9fb21a605a netlink: Add uint32Attr helper
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2014-09-16 09:59:15 -04:00
Victor Marmol c1fa152a61 Merge pull request #190 from titanous/netlink-cleanup
Netlink cleanup
2014-09-15 15:36:05 -07:00
Jonathan Rudenberg f5b7ee170f netlink: Cleanup veth pair created during tests
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2014-09-15 14:18:17 -04:00
Jonathan Rudenberg 65842f749b netlink: Extract message checks into reusable method
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2014-09-15 14:18:17 -04:00
Jonathan Rudenberg 6e4334a68e netlink: Cache native endianness during init
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
2014-09-14 20:40:41 -04:00
Michael Crosby d83cb4e1f6 Merge pull request #185 from cf-guardian/typed_errors
Add rich errors to the API
2014-09-12 14:10:01 -07:00
Victor Marmol 7f9256cdc9 Merge pull request #189 from vmarmol/cache-mounts
Cache cgroup root mount location.
2014-09-10 17:54:06 -07:00
Victor Marmol 3cbe3eb3f6 Cache cgroup root mount location.
We calculate this on every cgroup call. It comprised of 30%+ of the CPU
usage in cAdvisor.

Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
2014-09-10 17:44:13 -07:00
Victor Marmol 1fe601949e Merge pull request #186 from cf-guardian/devices_error_injection
Devices error injection
2014-09-09 10:58:09 -07:00