Commit Graph

3169 Commits

Author SHA1 Message Date
Mrunal Patel 87d08d1ac2 Simplify loop to a simple array append
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-01-06 16:02:05 -08:00
Mrunal Patel 84a3bd250c Simplify error handling on function return
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-01-06 15:57:31 -08:00
Qiang Huang 20f0ca7306 Fix typos
Found by:
https://goreportcard.com/report/github.com/opencontainers/runc#misspell

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-01-06 10:54:33 +08:00
Qiang Huang f3c16acd47 Fix go_vet errors
runc/libcontainer/configs/namespaces_syscall_unsupported.go
Line 7: error: unreachable code (vet)
Line 14: error: unreachable code (vet)

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-01-06 10:20:27 +08:00
Daniel, Dao Quang Minh 1a9dd2678d Merge pull request #1253 from xlgao-zju/add-goreport-badge
Add badge for Go Report Card
2017-01-05 12:52:09 +00:00
Xianglin Gao 27f7490b7e Add badge for Go Report Card
Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
2017-01-04 16:52:29 +08:00
Fengtu Wang b5d4da872c remove `-i` option to avoid failure of jenkins in non-interactive mode.
Signed-off-by: Fengtu Wang <wangfengtu@huawei.com>
2017-01-04 16:33:05 +08:00
Qiang Huang 1e4ca86a72 Merge pull request #1250 from caniszczyk/add-travis-badge
Add Travis CI badge to README
2017-01-04 14:12:12 +08:00
Wang Long 4732f46fd9 small refactor
Signed-off-by: Wang Long <long.wanglong@huawei.com>
2017-01-04 11:39:44 +08:00
Mrunal Patel 7b500a373d Merge pull request #1243 from cyphar/govet-cleanup
*: fix go-vet failures
2017-01-03 17:59:07 -08:00
Chris Aniszczyk 165fba9e4b Add Travis CI badge to README
https://travis-ci.org/opencontainers/runc

Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2017-01-03 19:31:29 -06:00
Aleksa Sarai 816efe0abd
*: fix go-vet failures
Previously, we would get failures with go-vet with test files.

% go vet ./...
libcontainer/integration/exec_test.go:42: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:43: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:184: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:185: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:1568: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:1569: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:1600: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/exec_test.go:1601: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/execin_test.go:92: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/execin_test.go:93: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/execin_test.go:506: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields
libcontainer/integration/execin_test.go:507: github.com/opencontainers/runc/libcontainer/configs.IDMap composite literal uses unkeyed fields

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-01-04 09:48:32 +11:00
Wang Long 4dfd350a38 cgroups: update the comments
Signed-off-by: Wang Long <long.wanglong@huawei.com>
2017-01-03 22:40:12 +08:00
Wang Long 61640b099a Fix the outdated comment for Error interface
Signed-off-by: Wang Long <long.wanglong@huawei.com>
2017-01-03 15:06:47 +08:00
Qiang Huang c441a2fe0c Merge pull request #1246 from cyphar/travis-ci
travis: add travis-ci
2017-01-03 10:53:17 +08:00
Aleksa Sarai 4a7934d86f
travis: add travis-ci
This sets up a working Travis CI configuration, that runs all of our
integration and unit tests (and also checks a simple raw-build on the
Travis server).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-31 05:15:29 +11:00
Aleksa Sarai db25629d46
merge branch 'pr-1203'
Closes #1203
LGTMs: @cyphar @hqhq
2016-12-31 04:15:12 +11:00
Zhang Wei 51baedf3f3 Add integration for update rt period and runtime
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-12-27 17:57:13 +08:00
Qiang Huang f376b8033d Merge pull request #1222 from justincormack/remount-fixes
Split the code for remounting mount points and mounting paths.
2016-12-27 15:24:56 +08:00
Aleksa Sarai c6d8a2f26f
merge branch 'pr-1158'
Closes #1158
LGTMs: @hqhq @cyphar
2016-12-26 13:59:47 +11:00
Aleksa Sarai cae7979d1f
merge branch 'pr-1217'
Closes #1217
LGTMs: @cyphar @hqhq
2016-12-24 09:31:38 +11:00
Aleksa Sarai 303f9a5ebb
merge branch 'pr-1201'
Closes #1201
LGTMs: @cyphar @hqhq
2016-12-23 09:32:30 +11:00
Zhang Wei a344b2d6a8 sync up `HookState` with OCI spec `State`
`HookState` struct should follow definition of `State` in runtime-spec:

* modify json name of `version` to `ociVersion`.
* Remove redundant `Rootfs` field as rootfs can be retrived from
`bundlePath/config.json`.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-12-20 00:00:43 +08:00
Qiang Huang 9a1e53eafc Merge pull request #1233 from WeiZhang555/bump-runtime-spec
Bump runtime-spec to v1.0.0-rc3
2016-12-19 15:35:08 +08:00
Qiang Huang 6222318e93 Merge pull request #1231 from Mashimiao/fix-rename-ocitools
rename ocitools to oci-runtime-tool
2016-12-19 15:27:45 +08:00
Zhang Wei 8eea644ccc Bump runtime-spec to v1.0.0-rc3
* Bump underlying runtime-spec to version 1.0.0-rc3
* Fix related changed struct names in config.go

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-12-17 14:02:35 +08:00
Qiang Huang 27a67c9aa0 Merge pull request #1226 from nhlfr/dockerfile-cleanup
Clean apt archives and source directories in Dockerfile
2016-12-17 09:47:55 +08:00
Justin Cormack 50acb55233 Split the code for remounting mount points and mounting paths.
A remount of a mount point must include all the current flags or
these will be cleared:

```
The mountflags and data arguments should match the values used in the
original mount() call, except for those parameters that are being
deliberately changed.
```

The current code does not do this; the bug manifests in the specified
flags for `/dev` being lost on remount read only at present. As we
need to specify flags, split the code path for this from remounting
paths which are not mount points, as these can only inherit the
existing flags of the path, and these cannot be changed.

In the bind case, remove extra flags from the bind remount. A bind
mount can only be remounted read only, no other flags can be set,
all other flags are inherited from the parent. From the man page:

```
Since Linux 2.6.26, this flag can also be used to make an existing
bind mount read-only by specifying mountflags as:

MS_REMOUNT | MS_BIND | MS_RDONLY

Note that only the MS_RDONLY setting of the bind mount can be changed
in this manner.
```

MS_REC can only be set on the original bind, so move this. See note
in man page on bind mounts:

```
The remaining bits in the mountflags argument are also ignored, with
the exception of MS_REC.
```

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-16 14:01:17 -08:00
Ma Shimiao 9befe82cde Makefile: add manpage cleanup
I think generated manpages should also need cleanup

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-12-16 14:33:05 +08:00
Ma Shimiao f22230a79d rename ocitools to oci-runtime-tool
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-12-16 14:04:50 +08:00
Michal Rostecki 5032f434f3 Clean apt archives and source directories in Dockerfile
Signed-off-by: Michal Rostecki <michal@kinvolk.io>
2016-12-14 23:42:32 +01:00
Mrunal Patel 083933fb90 Merge pull request #1221 from sameo/topic/validator
validate: Check that the given namespace path is a symlink
2016-12-10 16:12:31 -08:00
Samuel Ortiz f19aa2d04d
validate: Check that the given namespace path is a symlink
When checking if the provided networking namespace is the host
one or not, we should first check if it's a symbolic link or not
as in some cases we can use persistent networking namespace under
e.g. /var/run/netns/.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2016-12-10 11:14:49 +01:00
Mrunal Patel 34f23cb99c Merge pull request #1018 from cyphar/console-rewrite
Consoles, consoles, consoles.
2016-12-07 14:37:19 -08:00
Mrunal Patel 8f55948aa5 Don't add device to list if it doesn't exist anymore
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-12-07 11:08:00 -08:00
Aleksa Sarai 47ea5c75eb
merge branch 'eparis/pr-1216'
Closes opencontainers/runc#1216
LGTMs: @mrunalp @rhatdan @cyphar
2016-12-07 08:25:54 +11:00
Eric Paris a4f3123c35 Fix thread safety of SelinuxEnabled and getSelinuxMountPoint
Both suffered from different race conditions.

SelinuxEnabled assigned selinuxEnabledChecked before selinuxEnabled.
Thus racing callers could see the wrong selinuxEnabled.

getSelinuxMountPoint assigned selinuxfs to "" before it know the right
value. Thus racing could see "" improperly.

The gate selinuxfs, enabled, and mclist all on the same lock
2016-12-06 13:50:03 -05:00
Qiang Huang 5974b4c7a1 Merge pull request #1213 from cyphar/add-security-email
*: add information about security mailing list
2016-12-06 14:18:16 +08:00
Aleksa Sarai ac422aa545
*: add information about security mailing list
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-03 18:54:53 +11:00
Mrunal Patel 4271a8b5ae Merge pull request #1211 from YummyPeng/fix_typo
Fix typo.
2016-12-01 11:14:42 -08:00
Mrunal Patel 5d842907c6 Merge pull request #1210 from xianlubird/fix-typo
Fix typo
2016-12-01 11:14:19 -08:00
Mrunal Patel b66bf7d614 Merge pull request #1207 from datawolf/small-fxi
delete unused variable
2016-12-01 11:13:51 -08:00
Mrunal Patel 8002a8c894 Merge pull request #1208 from datawolf/tiny-refactor
tiny refactor
2016-12-01 11:13:33 -08:00
Yuanhong Peng 30e2d4b9da Fix typo.
Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>
2016-12-01 16:48:09 +08:00
Xianlu Bird e2e6f58e4e Fix typo
Fix typo
2016-12-01 15:23:58 +08:00
Aleksa Sarai b0fc85e99d
tests: add tty bats integration
Add some tests to ensure that we always get a proper console (created
inside the container). This is done by checking that the
/proc/self/fd/[012] "symlinks" are always referencing something in
/dev/pts/*.

This patch is part of the console rewrite patchset.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-01 15:49:37 +11:00
Aleksa Sarai 972c176ae4
tests: fix all the things
This fixes all of the tests that were broken as part of the console
rewrite. This includes fixing the integration tests that used TTY
handling inside libcontainer, as well as the bats integration tests that
needed to be rewritten to use recvtty (as they rely on detached
containers that are running).

This patch is part of the console rewrite patchset.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-01 15:49:37 +11:00
Aleksa Sarai bda3055055
*: update busybox test rootfs
Switch to the actual source of the official Docker library of images, so
that we have a proper source for the test filesystem. In addition,
update to the latest released version (1.25.0 [2016-06-23]) so that we
can use more up-to-date applets in our tests (such as stat(3)).

This patch is part of the console rewrite patchset.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-01 15:49:36 +11:00
Aleksa Sarai 1543444ada
contrib: add recvtty proof-of-concept
This is a proof-of-concept for the --console-socket API. It just acts as
a dumb input-output copy process (nowhere near as good as the internal
runC one since it doesn't handle console resizes or signals). It also
provides a test-friendly mode that will be used in the bats integration
tests.

This patch is part of the console rewrite patchset.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-01 15:49:36 +11:00
Aleksa Sarai 7df64f8886
runc: implement --console-socket
This allows for higher-level orchestrators to be able to have access to
the master pty file descriptor without keeping the runC process running.
This is key to having (detach && createTTY) with a _real_ pty created
inside the container, which is then sent to a higher level orchestrator
over an AF_UNIX socket.

This patch is part of the console rewrite patchset.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-01 15:49:36 +11:00