Commit Graph

763 Commits

Author SHA1 Message Date
Aleksa Sarai 6516e6ce8c user: MAINTAINERS: add cyphar as a maintainer
This patch adds Aleksa Sarai to the maintainer list for libcontainer's
user API.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-12-12 05:11:18 +11:00
Michael Crosby 0d0402712b Merge pull request #287 from dqminh/execin-test
add support for testing execin
2014-12-10 10:12:46 -08:00
Daniel, Dao Quang Minh 2f1b2ce204 add support for testing execin
when the test binary starts, it detects whether it should run the container
initialization code or the execin initialization code based on the suppplied
arguments. The execin initialization code is taken from docker.

also added a sample test for execin process.

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-12-10 03:39:00 -05:00
Victor Marmol 58fc93160e Merge pull request #285 from hqhq/hq_add_cpuset_mems
cgroups: add support for cpuset.mems
2014-12-06 09:44:13 +08:00
Qiang Huang e3b14402eb cgroups: add support for cpuset.mems
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-12-05 17:37:24 -08:00
Mrunal Patel 6ffd59a784 Merge pull request #279 from crosbymichael/namespaces-join
Change namespaces config to include path for setns
2014-12-04 11:19:48 -08:00
Michael Crosby 12124f731d Remove unused namespace types
This removes the unsued namespace types from the namespace package
and simplifies getting the values for the namespaces.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-03 15:47:26 -08:00
Michael Crosby 549f508d5b Change namespaces config to include path for setns
This changes the namespace configuration on the config to include the
name of the namespace along with an optional path.  This path is used to
point to a file of another namespace for the namespace so that it can be
joined in place of the empty, initialized namespace.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-03 12:00:43 -08:00
Mrunal Patel 53eca435e6 Merge pull request #273 from vishh/prctl
Set child sub reaper option on nsenter
2014-12-02 15:28:38 -08:00
Michael Crosby b02b0b037b Merge pull request #278 from milosgajdos83/macvtap
Introducing macvtap device to netlink package
2014-12-02 15:16:51 -08:00
Rohit Jnagal 51aa43f44c Merge pull request #282 from crosbymichael/spec
Add container spec
2014-12-02 00:03:08 -08:00
Michael Crosby c511f7cfed Add container spec
This document specifies the current container specification with all the
underlying setup and configuration that goes into making a container.
This is the v1 spec that is today but allows for flexability when we
introduce more features such as seccomp default profiles and more.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-01 16:42:01 -05:00
Michael Crosby 7ce34f58cb Merge pull request #280 from cpuguy83/add_rlimit_support
Add support for setting rlimit for contianer
2014-11-26 11:14:49 -08:00
Brian Goff e6cc8fc713 Add support for setting rlimit for contianer
Adds a new item to the config struct []*Rlimit
Rlimit takes a type (ie, syscall.RLIMIT_NOFILE) and the hard/soft limit
(As max/cur)

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2014-11-26 14:10:01 -05:00
Mrunal Patel 72942137ef Merge pull request #277 from yoheiueda/support-for-ppc64-ppc64le-s390x
Add support for ppc64, ppc64le, s390x
2014-11-24 12:40:28 -08:00
Milos Gajdos 7075dd2cc2 Introducing macvtap device to netlink package
Small refactoring of MacVlan calls. Adds tests, too.

Signed-off-by: Milos Gajdos <milosgajdos83@gmail.com> (github: milosgajdos83)
2014-11-21 15:44:15 +00:00
Yohei Ueda 3bd18c2c54 Add support for ppc64, ppc64le, s390x
Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
2014-11-21 14:18:48 +00:00
Mrunal Patel 0aa8280708 Merge pull request #276 from unclejack/add_txq
netlink: add NetworkSetTxQueueLen to set qlen
2014-11-20 20:08:55 -08:00
Michael Crosby a943fbabec Merge pull request #275 from rhatdan/selinux
Add call to label to allow it to tell kernel how to label created files
2014-11-20 15:32:25 -08:00
unclejack 209b1c1f99 netlink: add NetworkSetTxQueueLen to set qlen
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-11-21 01:24:15 +02:00
Dan Walsh dd89eb9eca Add call to label to allow it to tell kernel how to label created files
SELinux supports a call that tells the kernel, from this point onward
create content with this label.  If you pass "", the kernel will
go back to the default.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-11-20 17:39:39 -05:00
Mrunal Patel 84c1636580 Merge pull request #274 from crosbymichael/revert-hairpin-nat
Remove hairpin nat on veth create
2014-11-20 13:54:10 -08:00
Michael Crosby 378491e907 Remove hairpin nat on veth create
Writing to this file within /sys is casuing some issues for
older kernels, specifically with 2.6.xx, where the write is failing
because /sys is becoming ro.  We will continue to work on the 2.6 issues
but for the time being we cannot ship this with it enabled as it's
breaking all container runs.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-19 17:08:49 -08:00
Vishnu Kannan 4c6df516ae Set child sub reaper option on nsenter to help cleanup all processes orphaned via ExecIn.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-11-19 20:14:20 +00:00
Mrunal Patel 101dff031b Merge pull request #271 from crosbymichael/always-set-cpuset
libcontainer: setup cpuset cgroup by default
2014-11-18 18:13:03 -08:00
Michael Crosby 75093be3c9 Always join fs.Cpuset reguardless of value
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-17 19:06:20 -08:00
Qiang Huang 9c7bd7cd9e libcontainer: setup cpuset cgroup by default
Currently if we don't use --cpuset, the cpuset cgroup is not
created, it's bad if we want to modify cpuset config subsequently,
change the behavior to make it right.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-11-17 19:06:20 -08:00
Victor Marmol 28cb5f9dfd Merge pull request #267 from crosbymichael/cgroup-paths
Use cgroup paths for stats and removal
2014-11-17 12:05:56 -08:00
Michael Crosby 5b623a6e43 Remove cgutil cli application as it is not being used
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-17 11:56:19 -08:00
Michael Crosby 29b1d2b23f Move RemovePaths into cgroups pkg for reuse
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-17 11:56:19 -08:00
Michael Crosby bc7efa6b81 Have cgroup.Apply return paths to setup cgroups
There is no reason to have a special type returned from the cgroups
Apply function for getting the paths and cleanup.  With access to the
paths we can just delete what we need.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-17 11:56:19 -08:00
Michael Crosby 5cacd48132 Remove systemd.GetStats
Because we are using the paths that are created when we initially setup
cgroups for a container we no longer have to dynamically generates them
when a user requests stats.  This allows us to fully use the fs stats
code without having system create it's paths.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-17 11:56:19 -08:00
Donald Huang 6c6808e5bf Change arguments to fs.GetStats to be map[string]string
Allows us to remove systemd.GetPaths later

Signed-off-by: Donald Huang <don.hcd@gmail.com>
2014-11-17 11:56:19 -08:00
Mrunal Patel 05661b16b2 Merge pull request #269 from aholler/master
Use SYS_SETUID32 for system.Setuid() on Linux for ARM
2014-11-17 09:47:00 -08:00
Alexander Holler def2a7b14e Use SYS_SETUID32 for system.Setuid() on Linux for ARM
Besides possible other problems 16bit UIDs might be disabled by the kernel
configuration on Linux for ARM (see CONFIG_UID16).

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
2014-11-17 14:16:32 +01:00
Mrunal Patel 3f17f897c2 Merge pull request #268 from crosbymichael/sethostname
Provide better sethostname error message
2014-11-15 09:10:30 -08:00
Michael Crosby 933fc88943 Provide better sethostname error message
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-14 17:46:11 -08:00
Michael Crosby 3496a63d87 Merge pull request #265 from crosbymichael/fix-dind
Update the path to project from hack
2014-11-14 15:52:21 -08:00
Michael Crosby 1272b74cc0 Update the path to project from hack
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-14 15:43:19 -08:00
Michael Crosby 38f761cf16 Merge pull request #264 from dqminh/fix-exec-env
Set correct env variables for `docker exec` commands
2014-11-14 14:59:55 -08:00
Daniel, Dao Quang Minh f61288fe37 use os.Environ() to set exec command's env
because `LoadContainerEnvironment` is already run, os.Environ() will return the
correct environment variables for the exec command (i.e. removed duplicated
envs, set HOME for user etc...)

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-14 12:51:14 -05:00
Michael Crosby 1c5d836b05 Merge pull request #262 from hansrodtang/patch-1
Updated cover tool import path.
2014-11-13 23:22:46 -08:00
Hans Rødtang 9d86e0eae4 Updated cover tool import path.
Signed-off-by: Hans Rødtang <hansrodtang@gmail.com>
2014-11-14 06:05:18 +01:00
Michael Crosby c529ab68df Merge pull request #260 from donhcd/fix_typo
Fix typo in json tag
2014-11-11 22:04:32 -08:00
Donald Huang 1aafba9f87 Fix typo in json tag
throlling_data -> throttling_data

Signed-off-by: Donald Huang <don.hcd@gmail.com>
2014-11-11 23:34:55 +00:00
Michael Crosby e48d21cf3c Merge pull request #259 from mrunalp/fix_parse_ip_rc
Fix the return code check for ParseIP.
2014-11-10 10:40:39 -08:00
Mrunal Patel 6f7adc79c8 Fix the return code check for ParseIP.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com> (github: mrunalp)
2014-11-10 13:33:29 -05:00
Michael Crosby 4ae31b6ceb Merge pull request #158 from cyphar/refactor-expose-user
Refactor and expose private functions within `libcontainer/user`.
2014-11-06 16:17:30 -08:00
Aleksa Sarai bf12e3c1f5 user: add unit tests for GetExecUser
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-11-07 11:07:21 +11:00
Aleksa Sarai 195d8d544a user: lookup: added os/user-like lookup API
This patch adds an os/user-like user lookup API, implemented in pure Go.
It also has some features not present in the standard library
implementation (such as group lookups).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
2014-11-07 11:07:21 +11:00