Commit Graph

67 Commits

Author SHA1 Message Date
Lantao Liu
ba8788c6b9 Update kubernetes dependency to 1.15.0.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-31 23:52:03 -07:00
Michael Crosby
5eddc1a2cc Use container'd oci opts for spec generation
This bumps the containerd and sys packages in CRI

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Remove runtime-tools

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Update tests for oci opts package

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-27 16:57:04 -04:00
Lantao Liu
238658719f Cleanup pod annotation test and only support tailing wildcard.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-25 12:54:34 -07:00
Harshal Patil
effd82227c Add support for passing sandbox annotations to runtime
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
2019-03-21 14:38:14 +05:30
Mike Brown
bf4e7a885c test filtering of container create masks when privileged
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2019-03-14 08:17:56 -05:00
Lantao Liu
3691cb6550 Fix /etc/hostname backward compatibility issue for in-place upgrade.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-12 01:17:41 -07:00
Lantao Liu
0464298b1e Use clean path for map and comparison.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-03 21:19:50 -08:00
Lantao Liu
b2cd840042
Merge pull request #1045 from Random-Liu/fix-env-performance-issue
Fix env performance issue
2019-02-12 11:03:33 -08:00
Lantao Liu
ec6dd37691 Add env cache.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 03:02:20 -08:00
Lantao Liu
089d4fbfb8 Set /etc/hostname.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 00:18:00 -08:00
Lantao Liu
b1ad4ee9b6 Add unit test for DisableCgroup, RestrictOOMScoreAdj.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-03 10:47:34 -08:00
JoeWrightss
37085692e2 fix spelling error: contaner -> container
Signed-off-by: JoeWrightss <zhoulin.xie@daocloud.io>
2018-12-07 22:56:09 +08:00
Lantao Liu
f08a90ff64 Fix hostname env.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-10 10:58:17 -07:00
Lantao Liu
db8500d10c
Merge pull request #892 from Random-Liu/fix-volume-mount-order
Sort volume mount.
2018-09-06 14:44:45 -07:00
Lantao Liu
3e4cec8739 Add MaskedPaths and ReadonlyPaths support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-04 23:49:16 -07:00
Lantao Liu
063f8158f8 Sort volume mount.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-04 22:43:37 -07:00
Filipe Brandenburger
01d77d44f5 Update github.com/opencontainers/runtime-tools to v0.6.0
Also add new dependencies on github.com/xeipuuv/gojson* (brought up by
new runtime-tools) and adapt the containerd/cri code to replace the APIs
that were removed by runtime-tools.

In particular, add new helpers to handle the capabilities, since
runtime-tools now split them into separate sets of functions for each
capability set.

Replace g.Spec() with g.Config since g.Spec() has been deprecated in the
runtime-tools API.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2018-06-20 13:52:50 -07:00
Lantao Liu
b367f30097 Erase ambient capabilities.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-06-08 14:37:05 -07:00
Lantao Liu
a5d1332e8f Explicitly set rw for privileged container.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-05-07 15:13:14 -07:00
Lantao Liu
279fa853a6 Always mount sysfs as rw.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-04-26 18:58:26 -07:00
Mike Brown
94df315de8 adds volatile state directory to the fs plan for cntrs/pods/fifo
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-03-24 00:05:52 +00:00
Lantao Liu
387da59ee5 Rename all variables to remove "cricontainerd".
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-19 21:59:32 +00:00
Mike Brown
d4e7154625 move links for cri-containerd to cri
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-03-13 17:06:26 -05:00
Lantao Liu
46fc92f65f Use new namespace mode and support shared pid namespace.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-08 03:10:57 +00:00
Lantao Liu
4dfd8250fd Fix a privileged check.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-27 02:25:52 +00:00
Lantao Liu
6fadb7f5e9 Minor code cleanup.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-18 07:31:16 +00:00
Jose Carlos Venegas Munoz
b383b0261a Annotations: Provide container metadata for VM based runtimes
For hypervisor-based container runtimes (like Kata Containers, Clear Containers
or runv) a pod will be created in a VM and then create containers within the VM.

When a runtime is requested for container commands like create and start, both
the instal "pause" container and next containers need to be added to the pod
namespace (same VM).

A runtime does not know if it needs to create/start a VM or if it needs to add a
container to an already running VM pod.

This patch adds a way to provide this information through container annotations.
When starting a container or a sandbox, 2 annotations are added:

- type (Container or Sandbox)
- sandbox name

This allow to a VM based runtime to decide if they need to create a pod VM or
container within the VM pod.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-01-17 09:57:20 -06:00
Lantao Liu
025ffe551f Rename kubernetes-incubator/cri-containerd to containerd/cri-containerd.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-10 22:35:33 +00:00
Daniel Nephin
85d3bf0660 Use SpecOpts from new oci package
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-28 15:30:11 -05:00
Ian Campbell
d75e0882c4 typo: subtract not substract.
Signed-off-by: Ian Campbell <ijc@docker.com>
2017-10-13 09:50:17 +01:00
Yanqiang Miao
c65921b16a Get the mountInfo by 'LookupMount' in containerd
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-10-12 11:09:24 +08:00
Lantao Liu
bde8b0517e Update kubernetes and containerd.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-10-11 06:16:19 +00:00
Lantao Liu
23b8330b44 Merge pull request #322 from miaoyq/fix-314
Update kubernetes version to the PR#52395 and support `unconfined` apparmor
2017-10-04 10:49:56 -07:00
Yanqiang Miao
9f656cdda4 Support unconfined apparmor
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-10-04 09:50:27 +08:00
Lantao Liu
a81a47bf9b Fix update container resources
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-10-03 06:03:39 +00:00
Lantao Liu
cd57d063c5 Add systemd cgroup support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-09-26 06:44:30 +00:00
Lantao Liu
21233b22be Check seccomp enable and add unit test for seccomp/apparmor.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-09-25 23:09:26 +00:00
Yanqiang Miao
49eb38a5d4 Ensure the mount point is propagated
mount with `rshared`, the host path should be shared.
mount with `rslave`, the host pash should be shared or slave.

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-09-19 14:21:21 +08:00
Lantao Liu
cd27050425 Add image volume support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-09-15 11:25:55 +01:00
Ian Campbell
56539bd3a4 Require generateContainerSpec passes during tests and abort if not
This is achieved by switching `assert.NoError` to `require.NoError` in several
places.

Otherwise the test code will continue and dereference a nil spec, leading to a
panic which obscures the real failure.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-09-15 11:06:25 +01:00
Lantao Liu
0bfcdd39ab Remove /run mount for backward compatibility with docker.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-09-09 07:34:00 +00:00
Lantao Liu
3e4b4234c6 Merge pull request #218 from miaoyq/fixes-185
Update kubernetes version and support mount propagation
2017-09-06 21:03:56 -07:00
Yanqiang Miao
9da460ec0a Support mount propagation
fixex #185

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-09-07 08:58:20 +08:00
Lantao Liu
8569fa366e Merge pull request #215 from Random-Liu/add-capability-all
Add "ALL" capabilities support.
2017-09-05 18:14:36 -07:00
Lantao Liu
d02ecc4673 Add "ALL" capabilities support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-09-06 00:05:08 +00:00
Ian Campbell
1dea8fdfc4 Handle environment variables which containe spaces
This avoids errors such as:

    spec: invalid environment variable "JAVA_OPTS=-Djava.security.egd=file:/dev/urandom"

use SplitN(2) to get the envvar name and value while allowing the value to
contain `=`.

Add some variables to the test data which have one or more `=` in the value.
Since this makes the resulting list of variables to check rather long split the
check in two and check the container config and image config derived values
independently.

Signed-off-by: Ian Campbell <ijc@docker.com>
2017-09-05 23:06:07 +01:00
Yanqiang Miao
0c3304e006 Support selinux options/label
Support selinux optios/label

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-08-31 19:20:12 +08:00
Lantao Liu
3f4978b77b Use rbind and rprivate in bind mount.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-08-30 01:40:03 +00:00
Lantao Liu
f46cd1a71a Disable pid namespace sharing
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-08-28 05:44:46 +00:00
Lantao Liu
270e09ab26 Use containerd WithUserID.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-08-25 21:11:56 +00:00