Commit Graph

1040 Commits

Author SHA1 Message Date
Brian Pursley
aa04fc9d53 Change "failed to stop sandbox" error message to use state name instead of numeric value
Signed-off-by: Brian Pursley <bpursley@cinlogic.com>
2020-06-27 16:45:08 -04:00
Kevin Parsons
210561a8e3 Support named pipe mounts for Windows containers
Adds support to mount named pipes into Windows containers. This support
already exists in hcsshim, so this change just passes them through
correctly in cri. Named pipe mounts must start with "\\.\pipe\".

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2020-06-25 12:01:08 -07:00
Mike Brown
f5c7ac9272 fix for image pull linter change
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-06-24 18:10:31 -05:00
Davanum Srinivas
3ee62de2bf
remove unused method
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-22 15:03:47 -04:00
Davanum Srinivas
cbb7c28f19
Add copyright headers
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-22 14:49:13 -04:00
Davanum Srinivas
e2072b71cc
Copy kubernetes/pkg/util/bandwidth
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-22 14:48:25 -04:00
Davanum Srinivas
2909022a6e
Make local copy of kubelet/cri/streaming
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-22 13:54:34 -04:00
Davanum Srinivas
41f184f15b
Update vendor.conf to kubernetes 1.19.0-beta.2
update streaming import path
switch remote package path

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-22 08:44:49 -04:00
Michael Crosby
6164822714
Merge pull request #1508 from janosi/sctp-hostport
Remove the protocol filter from the HostPort management
2020-06-15 14:48:37 -04:00
Mike Brown
b661ad711e
Merge pull request #1504 from lorenz/ignore-image-defined-volumes
Add option for ignoring volumes defined in images
2020-06-14 11:52:48 -05:00
Mike Brown
26dc5b9772
Merge pull request #1505 from dcantah/windows-cred-spec
Add GMSA credential spec passing
2020-06-14 11:52:33 -05:00
Laszlo Janosi
479dfbac45
Remove the protocol filter from the portMappings constructor.
Reason: originally it was introduced to prevent the loading of the SCTP kernel module on the nodes. But iptables chain creation alone does not load the kernel module. The module would be loaded if an SCTP socket was created, but neither cri nor the portmap CNI plugin starts managing SCTP sockets if hostPort / portmappings are defined.
Signed-off-by: Laszlo Janosi <laszlo.janosi@ibm.com>
2020-06-14 15:48:00 +00:00
Kenta Tada
730b7a932e Change the type of PdeathSignal
Use x/sys as same as runtime/v1/linux/runtime.go

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
2020-06-11 11:35:51 +09:00
Daniel Canter
9620b2e1da Add GMSA Credential Spec passing
Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2020-06-10 11:15:07 -07:00
Lorenz Brun
5a1d49b063 Add option for ignoring volumes defined in images
Signed-off-by: Lorenz Brun <lorenz@brun.one>
2020-06-09 21:02:47 +02:00
Brian Goff
c694c63176 Add config for registry http headers
This adds a configuration knob for adding request headers to all
registry requests. It is not namespaced to a registry.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-06-08 18:56:15 -07:00
Gaurav Singh
7213cd89d6 Process I/O: Fix goroutine leak
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-06-07 17:38:36 -04:00
Davanum Srinivas
d7ce093d63
Tolerate missing HugeTLB cgroups controller
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-01 12:07:32 -04:00
Akihiro Suda
2f601013e6 cgroup2: implement containerd.events.TaskOOM event
How to test (from https://github.com/opencontainers/runc/pull/2352#issuecomment-620834524):
  (host)$ sudo swapoff -a
  (host)$ sudo ctr run -t --rm --memory-limit $((1024*1024*32)) docker.io/library/alpine:latest foo
  (container)$ sh -c 'VAR=$(seq 1 100000000)'

An event `/tasks/oom {"container_id":"foo"}` will be displayed in `ctr events`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-01 14:00:13 +09:00
Maksym Pavlenko
17c61e36cb Fix cgroups path for base OCI spec
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2020-05-29 11:40:12 -07:00
Maksym Pavlenko
8d54f39753 Allow specify base OCI runtime spec
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2020-05-28 13:39:31 -07:00
Michael Crosby
72edf3016d Use new SELinux APIs
This moves most of the API calls off of the `labels` package onto the root
selinux package.  This is the newer API for most selinux operations.

Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-05-26 15:18:46 -04:00
Darren Shepherd
24209b91bf Add MCS label support
Carry of #1246

Signed-off-by: Darren Shepherd <darren@rancher.com>
Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-05-20 13:59:51 -05:00
Sascha Grunert
e2cedb9469
Increase port-forward timeout to 1s to fix e2e test
We encountered two failing end-to-end tests after the adoption of
https://github.com/containerd/cri/pull/1470 in
https://github.com/cri-o/cri-o/pull/3749:

```
Summarizing 2 Failures:
[Fail] [sig-cli] Kubectl Port forwarding With a server listening on 0.0.0.0 that expects a client request [It] should support a client that connects,
sends DATA, and disconnects
test/e2e/kubectl/portforward.go:343

[Fail] [sig-cli] Kubectl Port forwarding With a server listening on localhost that expects a client request [It] should support a client that connects
, sends DATA, and disconnects
test/e2e/kubectl/portforward.go:343
```

Increasing the timeout to 1s fixes the issue.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-05-12 12:43:14 +02:00
Derek McGowan
21ad9c4e21 Use digestset from go-digest
Removes docker/distribution dependency

Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-05-11 14:17:34 -07:00
payall4u
b437938d2f
Transfer error to ErrNotFound when kill a not exist container, also add
test case.

Signed-off-by: payall4u <404977848@qq.com>

Add integration test case

Signed-off-by: payall4u <404977848@qq.com>
2020-05-11 21:53:43 +08:00
Wei Fu
8252e54f93
Merge pull request #1472 from mxpv/profile
Add config flag to default empty seccomp profile
2020-05-11 10:16:00 +08:00
Mike Brown
bd0a76565a
Merge pull request #1469 from thaJeztah/remove_libcontainer_system
Remove dependency on libcontainer/system
2020-05-10 19:33:17 -05:00
Derek McGowan
dbedcf8706
Merge pull request #1449 from mikebrow/make-http-with-tlsconfig-a-warning
removes the error when tls is configured for https but http is tried first
2020-05-10 16:09:41 -07:00
Sebastiaan van Stijn
0e1b7bdb59
Remove dependency on libcontainer/system
This swaps the RunningInUserNS() function that we're using
from libcontainer/system with the one in containerd/sys.

This removes the dependency on libcontainer/system, given
these were the only functions we're using from that package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-10 21:58:16 +02:00
Maksym Pavlenko
674fe72aa8 Update docs for unset seccomp profile
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2020-05-10 10:46:58 -07:00
Sebastiaan van Stijn
c96373f6d5
newTransport(): remove deprecated DualStack option
The `DualStack` option was deprecated in Go 1.12, and is now enabled by default
(through commit github.com/golang/go@efc185029bf770894defe63cec2c72a4c84b2ee9).

> The Dialer.DualStack field is now meaningless and documented as deprecated.
>
> To disable fallback, set FallbackDelay to a negative value.

The default `FallbackDelay` is 300ms; to make this more explicit, this patch
sets `FallbackDelay` to the default value.

Note that Docker Hub currently does not support IPv6 (DNS for registry-1.docker.io
has no AAAA records, so we should not hit the 300ms delay).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-10 12:39:10 +02:00
Antonio Ojea
11a78d9d0f
don't use socat for port forwarding
use goroutines to copy the data from the stream to the TCP
connection, and viceversa, removing the socat dependency.

Quoting Lantao Liu, the logic is as follow:

When one side (either pod side or user side) of portforward
is closed, we should stop port forwarding.

When one side is closed, the io.Copy use that side as source will close,
but the io.Copy use that side as dest won't.

Signed-off-by: Antonio Ojea <antonio.ojea.garcia@gmail.com>
2020-05-09 00:54:30 +02:00
Maksym Pavlenko
38f19f991e Add config flag to default empty seccomp profile
This changes adds `default_seccomp_profile` config switch to apply default seccomp profile when not provided by k8s.a

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2020-05-08 13:24:38 -07:00
Wei Fu
48e797c77f RunPodSandbox: destroy network if fails or invalid
Should destroy the pod network if fails to setup or return invalid
net interface, especially multiple CNI configurations.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-05-01 12:07:33 +08:00
ktock
ca661c8dc9 Pass chained layer digests to snapshotter for parallel snapshot preparation
Currently, CRI plugin passes each layer digest to remote snapshotters
sequentially, which leads to sequential snapshots preparation. But it costs
extra time especially for remote snapshotters which need to connect to the
remote backend store (e.g. registries) for checking the snapshot existence on
each preparation.

This commit solves this problem by introducing new label
`containerd.io/snapshot/cri.chain` for passing all layer digests in an image to
snapshotters and by allowing them to prepare these snapshots in parallel, which
leads to speed up the preparation.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2020-04-28 15:03:08 +09:00
Mike Brown
4ea4ca99c7
Merge pull request #1455 from 6WIND/master
fix incomplete host device for PrivilegedWithoutHostDevices
2020-04-26 22:28:20 -05:00
Mike Brown
776c125e4f move up to latest critools; add apparmor profile check
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-04-26 16:16:48 -05:00
Mike Brown
1b60224e2e use containerd/project header test
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-04-22 19:35:37 -05:00
Thibaut Collet
98f8ec4995 fix incomplete host device for PrivilegedWithoutHostDevices
For a privilege pods with PrivilegedWithoutHostDevices set to true
host device specified in the config are not provided (whereas it is done for
non privilege pods or privilege pods with PrivilegedWithoutHostDevices set
to false as all devices are included).

Add them in this case.

Fixes: 3353ab76d9 ("Add flag to overload default privileged host device behaviour")
Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
2020-04-22 18:20:36 +02:00
Mike Brown
9d37687a95
Merge pull request #1436 from chethanah/add-container-name-annot
Support for additional OCI annotations: 'container-name'
2020-04-19 13:19:47 -05:00
Maksym Pavlenko
917e7646ae Add binary IO tests
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-04-17 16:50:43 -07:00
Maksym Pavlenko
9175401b28 Cleanup binary IO resources on error
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-04-17 15:56:21 -07:00
Maksym Pavlenko
0dc7c85956 Don't use timeout package when stopping shim logger
containerd loads timeout values from config.toml and populated those
values to `timeout` package at launch. So when using `timeout` package
from shim, there are default values and config file is ignored.
So use a hardcoded value for binary IO.

Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-04-17 15:06:18 -07:00
yang yang
d07f7f167a add default scheme if endpoint no scheme
Signed-off-by: yang yang <yang8518296@163.com>
2020-04-17 23:33:28 +08:00
Mike Brown
27f911d663 removes the error when tls is configured for https but http is tried first
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-04-16 13:23:56 -05:00
ktock
c1b7bcf395 Enable to pass additional handler on pull for stargz-based remote snapshots
Throughout container lifecycle, pulling image is one of the time-consuming
steps. Recently, containerd community started to tackle this issue with
stargz-based remote snapshots, as a non-core
subproject(https://github.com/containerd/stargz-snapshotter).

This snapshotter is implemented as a standard proxy plugin but it requires the
client to pass some additional information (image ref and layer digest) for each
pull operation to query layer contents on the registry. Stargz snapshotter
project provides an image handler to do this and stargz snapshot users need to
pass this handler to containerd client.

This commit enables to use stargz-based remote snapshots through CRI by passing
the handler to containerd client on pull operation.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2020-04-16 20:53:52 +09:00
Chethan Suresh
7fc8652e32 Add OCI annotations for container name
Along with type(Sandbox or Container) and Sandbox name annotations
provide support for additional annotation:
  - Container name

This will help us perform per container operation by comparing it
with pass through annotations (eg. pod metadata annotations from K8s)

Signed-off-by: Chethan Suresh <Chethan.Suresh@sony.com>
2020-04-16 07:14:58 +05:30
Shengjing Zhu
4263229a7b Replace docker/distribution/reference with containerd/reference/docker
Since https://github.com/containerd/containerd/pull/3728
The docker/distribution/reference package is copied into containerd core

Signed-off-by: Shengjing Zhu <i@zhsj.me>
2020-04-16 03:29:58 +08:00
Mike Brown
d531dc492a
Merge pull request #1405 from fuweid/me-async-load-cnicnf
reload cni network config if has fs change events
2020-04-15 13:57:32 -05:00
Mike Brown
aa9b1885b5 fixes bad unit tests when selinux is enabled
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-04-15 12:28:11 -05:00
Maksym Pavlenko
0caa233158 Rework shim logger shutdown process
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-04-07 12:42:04 -07:00
Wei Fu
4ce334aa49 reload cni network config if has fs change events
With go RWMutex design, no goroutine should expect to be able to
acquire a read lock until the read lock has been released, if one
goroutine call lock.

The original design is to reload cni network config on every single
Status CRI gRPC call. If one RunPodSandbox request holds read lock
to allocate IP for too long, all other RunPodSandbox/StopPodSandbox
requests will wait for the RunPodSandbox request to release read lock.
And the Status CRI call will fail and kubelet becomes NOTReady.

Reload cni network config at every single Status CRI call is not
necessary and also brings NOTReady situation. To lower the possibility
of NOTReady, CRI will reload cni network config if there is any valid fs
change events from the cni network config dir.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-04-03 12:28:58 +08:00
Phil Estes
0c78dacbc5
Move isFifo from process/io to sys/ and make public
Make "IsFifo" a public function for use by other parts of containerd
codebase.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2020-03-25 10:44:17 -04:00
Li Yuxuan
cb0140063e Fix goroutine leak when exec/attach
The resize chan is never closed when doing exec/attach now. What's more,
`resize` is a recieved only chan so it can not be closed. Use ctx to
exit the goroutine in `handleResizing` properly.

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-03-24 10:42:54 +08:00
Sebastiaan van Stijn
e093a0ee08
Use local "ensureRemoveAll" instead of docker/pkg/system
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-12 20:21:14 +01:00
lifubang
488d6194f2 fix dial error when clean up a dead shim
Signed-off-by: lifubang <lifubang@acmcoder.com>
2020-03-12 10:57:55 +08:00
Akihiro Suda
fa72e2f693 cgroup2: do not unshare cgroup namespace for privileged
Conforms to the latest KEP:
0e409b4749/keps/sig-node/20191118-cgroups-v2.md (cgroup-namespace)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-09 01:49:04 +09:00
Sebastiaan van Stijn
f2edc6f164
vendor: update gotest.tools v3.0.2
full diff: https://github.com/gotestyourself/gotest.tools/compare/v2.3.0...v3.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-28 17:47:20 +01:00
Brandon Lum
8d5a8355d0 Updated docs and code for default nil behavior
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-02-27 23:42:03 +00:00
Kiril Vladimiroff
4dd75be2b9
Unify dialer implementations
Instead of having several dialer implementations, leave only one in
`pkg/dialer` and call it from `pkg/ttrpcutil`, `runtime/v(1|2)/shim`
which had their own

Closes #3471.

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>
2020-02-26 23:29:04 +02:00
Brandon Lum
ffcef9dc32 Addressed nits
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-02-24 20:45:57 +00:00
Brandon Lum
8df431fc31 Defer multitenant key model to image auth discussion
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-02-24 20:45:57 +00:00
Brandon Lum
c43a7588f6 Refactor encrypted opts and added unit test
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-02-24 20:45:57 +00:00
Brandon Lum
f0579c7b4d Implmented node key model for image encryption
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-02-24 20:45:57 +00:00
Mike Brown
f4b3cdb892
Merge pull request #1399 from mikebrow/pause-image-update
move to v3.2 for the pause image
2020-02-20 10:45:16 -06:00
Mike Brown
c9ed98462d move to v3.2 for the pause image
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-02-14 12:55:52 -06:00
Mike Brown
cf0e0a1e2c
Merge pull request #1332 from bg-chun/update_cri_for_hugepages
update cri-plugin to parse hugepages limit
2020-02-12 10:05:01 -06:00
Byonggon Chun
c02c24847f update cri-plugin to parse hugepages limit from CRI message
Signed-off-by: Byonggon Chun <bg.chun@samsung.com>
2020-02-06 15:28:24 +09:00
Justin Terry (VM)
a8cc66b37a Fix store error serialization to gRPC status codes
The pkg/store errors are duplicated errors of NotFound and AlreadyExist from
containerd's errdefs package and thus do not properly serialize when running
errdefs.ToGRPC on them. CRI runs this function on every return from a CRI
method so the conversion fails if there is a cache miss from the store caches
for containers or sandboxes. This change verifies that the errors are properly
converted to their gRPC values.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2020-02-05 18:32:45 -08:00
Akihiro Suda
2d28b60046 vendor kubernetes 1.17.1
Corresponds to https://github.com/kubernetes/kubernetes/blob/v1.17.1/go.mod

note: `k8snet.ChooseBindAddress()` was renamed to `k8snet.ResolveBindAddress()` in afa0b808f8

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-01-22 02:06:50 +09:00
Akihiro Suda
5e5960f2bc
Merge pull request #1376 from Zyqsempai/add-cgroups-v2-metrics
Cgroupv2: Added CPU, Memory metrics
2020-01-21 23:21:09 +09:00
Boris Popovschi
6b8846cdf8 vendor updated + added cgroupv2 metrics
Signed-off-by: Boris Popovschi <zyqsempai@mail.ru>
2020-01-17 11:55:06 +02:00
Akihiro Suda
71740399e0 cgroup2: unshare cgroup namespace for containers
In cgroup v1 container implementations, cgroupns is not used by default because
it was not available in the kernel until kernel 4.6 (May 2016), and the default
behavior will not change on cgroup v1 environments, because changing the
default will break compatibility and surprise users.

For cgroup v2, implementations are going to unshare cgroupns by default
so as to hide /sys/fs/cgroup from containers.

* Discussion: https://github.com/containers/libpod/issues/4363
* Podman PR (merged): https://github.com/containers/libpod/pull/4374
* Moby PR: https://github.com/moby/moby/pull/40174

This PR enables cgroupns for containers, but pod sandboxes are untouched
because probably there is no need to do.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-01-09 14:58:30 +09:00
Akihiro Suda
aaddaa2732 bump up the default runtime to "io.containerd.runc.v2"
The former default runtime "io.containerd.runc.v1" won't support new features
like support for cgroup v2: containerd/containerd#3726

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-12-16 11:53:58 +09:00
Lantao Liu
0c2d3b718d Fix privileged devices.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-12-09 17:43:06 -08:00
Lantao Liu
78708b20c7
Merge pull request #1351 from Random-Liu/better-unknown-state-handling
Better handle unknown state.
2019-12-09 10:34:57 -08:00
Lantao Liu
facbaa0e79 Better handle unknown state.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-12-06 10:56:27 -08:00
bpopovschi
5d7bd738e4 Use containerD WithHostDevices
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
2019-12-04 11:34:46 +02:00
Lantao Liu
a6b6097c90 Fix container pid.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-12-02 01:02:22 -08:00
Lantao Liu
444f02a89e
Merge pull request #1344 from darfux/add-resolvconf-to-sandbox-container
Provide resolvConf to sandbox container's mounts
2019-12-01 21:25:19 -08:00
Li Yuxuan
dbc1fb37d0 Provide resolvConf to sandbox container's mounts
As https://github.com/kata-containers/runtime/issues/1603 discussed,
kata relies on such mount spec to setup resolv.conf for pod VM properly.

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-11-28 12:05:05 +08:00
Lantao Liu
ab6701bd11 Add insecure_skip_verify option.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-11-26 13:25:52 -08:00
Lantao Liu
5c2f33bd0d Cleanup path for windows mount
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-11-15 18:52:11 +00:00
Erik Wilson
7cc3938717 Set default scheme in registryEndpoints for host
Signed-off-by: Erik Wilson <Erik.E.Wilson@gmail.com>
2019-10-31 10:30:17 -07:00
Lantao Liu
65b9c31805 Use http for localhost, 127.0.0.1 and ::1 by default.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-28 19:07:43 -07:00
Lantao Liu
d95e21c89b Add container compute stats support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-25 14:32:02 -07:00
Michael Crosby
f8cca26f3c Handle large output in v2 shim with TTY
Reized the I/O buffers to align with the size of the kernel buffers with fifos
and move the close aspect of the console to key off of the stdin closing.

Fixes #3738

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-11 15:42:05 -04:00
Lantao Liu
2ce0bb0926 Update code for latest containerd.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-09 18:05:20 -07:00
Lantao Liu
18be6e3714 Use cached state instead of runc state.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-03 10:53:13 -07:00
Lantao Liu
358d672160 Add hostname CRI validation and unit test.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-25 16:11:27 -07:00
Lantao Liu
7fba77f238
Merge pull request #1298 from Random-Liu/set-sandbox-cpu-shares
Set default sandbox container cpu shares on windows.
2019-09-25 11:05:43 -07:00
Lantao Liu
2eba67a7ee
Merge pull request #1287 from crosbymichael/cgroups
Use type alias from containerd for cgroup metric types
2019-09-24 17:34:49 -07:00
Lantao Liu
f3ef10e9a2 Set default sandbox container cpu shares on windows.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-24 17:03:11 -07:00
Justin Terry (VM)
ed7873ef1e Forward SandboxConfig.Hostname to Workload container activation
1. For Windows the Hostname property is not inherited from the sandbox and must
be passed for the Workload container activations as well.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-09-24 10:21:17 -07:00
Lantao Liu
bad68a8270
Merge pull request #1284 from liyanhui1228/win_portforward
Add windows port forward support
2019-09-23 22:17:08 -07:00
Angela Li
dc413bd6d6 Add windows portforward support
Signed-off-by: Angela Li <yanhuil@google.com>
2019-09-23 17:36:43 -07:00
Michael Crosby
0a21292225 Check for more kill error types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-23 15:36:34 -04:00
Michael Crosby
c8c7c54a6e Use typealias for containerd metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-20 16:01:48 -04:00
Lantao Liu
470776c903
Merge pull request #1274 from Random-Liu/dualstack
Add DualStack support
2019-09-19 21:32:26 -07:00
Lantao Liu
c1ece0c801 Address comment.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-19 14:05:28 -07:00
Lantao Liu
b431316edd
Merge pull request #1280 from estesp/add-default-path-env
Add back default UNIX env to container config
2019-09-19 11:41:03 -07:00
Phil Estes
161abf8f5b
Fix golangci-lint findings
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-09-19 09:38:40 -04:00
Phil Estes
229eb19bd6
Add back default UNIX env to container config
Due to changes to the defaults in containerd, the CRI path to creating a
container OCI config needs to add back in the default UNIX $PATH (and
any other defaults) as that is the expected behavior from other
runtimes.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-09-19 09:00:25 -04:00
Antonio Ojea
fcd6bf318b Report Additional POD IPs
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-18 17:21:37 -07:00
Lantao Liu
dc964de85f Add windows implmenetation
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-18 10:46:29 -07:00
Lantao Liu
bbcf564745 Add windows image platform comparer
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-18 10:46:28 -07:00
Lantao Liu
c6cb25c158 Open/create log file with FILE_SHARE_DELETE on windows
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-18 10:46:28 -07:00
Michael Crosby
5a656cacb4 Move manpage gen to separate binary
This moves the man page generation to a separate binary

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-12 14:19:00 -04:00
Michael Crosby
f3a5b8c0a9 Add command to generate man pages
The climan package has a command that can be registered with any urfav
cli app to generate man pages.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-11 15:31:02 -04:00
Mike Brown
738179542a add a test case for container_annotations
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2019-09-10 11:28:59 +03:00
Ed Bartosh
05a9028969 Use container annotations when creating containers
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2019-09-10 11:28:59 +03:00
Ed Bartosh
e28689657a Add ContatinerAnnotations to the Runtime and config
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2019-09-10 11:28:51 +03:00
Lantao Liu
115b7664d9 Clarify some exec behavior.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 16:52:23 -07:00
Lantao Liu
50c73e6dc5 Move unix specific logic into _unix.go
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 16:23:42 -07:00
Lantao Liu
c6203ec13b Fix panic for task in unknown state.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 14:56:15 -07:00
Lantao Liu
2d03ccf5dd FDQN is a typo, and we don't support trailing dot in FQDN.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-30 13:31:04 -07:00
Nishchay
f41675d234
fix: support empty auth config for anonymous registry
- empty username means caller wants to use no credentials, typically for anonymous registry
- Fixes https://github.com/containerd/cri/issues/1249

Signed-off-by: Nishchay Kumar <mrawesomenix@gmail.com>
2019-08-28 10:24:31 -07:00
Lantao Liu
28aef2fe38 Support CNI DNS capabilities.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-22 14:29:04 -07:00
Lantao Liu
10acd8e769 Fix apparmor for privileged.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-19 16:28:45 -07:00
Michael Crosby
3995efc7c1 Update cni and go-cni to the v0.7.1 release
Closes #1236

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-14 16:19:37 +00:00
Lantao Liu
81ca274c6f Add wildcard mirror support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-13 12:02:57 -07:00
Michael Crosby
2e8ea9fd6b Allow timeouts to be configured in config
This adds a singleton `timeout` package that will allow services and user
to configure timeouts in the daemon.  When a service wants to use a
timeout, it should declare a const and register it's default value
inside an `init()` function for that package.  When the default config
is generated, we can use the `timeout` package to provide the available
timeout keys so that a user knows that they can configure.

These show up in the config as follows:

```toml
[timeouts]
  "io.containerd.timeout.shim.cleanup" = 5
  "io.containerd.timeout.shim.load" = 5
  "io.containerd.timeout.shim.shutdown" = 3
  "io.containerd.timeout.task.state" = 2

```

Timeouts in the config are specified in seconds.

Timeouts are very hard to get right and giving this power to the user to
configure things is a huge improvement.  Machines can be faster and
slower and depending on the CPU or load of the machine, a timeout may
need to be adjusted.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-13 17:36:32 +00:00
Lantao Liu
8021850e91
Merge pull request #1233 from AkihiroSuda/allow-ca-without-client-certs
allow non-mutual TLS
2019-08-11 17:07:57 -07:00
Lantao Liu
fd6c732cd7
Merge pull request #1232 from Random-Liu/avoid-schema1-roundtrip
Remove extra roundtrip for checking schema1.
2019-08-10 10:25:46 -07:00
Akihiro Suda
28e492fce0 allow non-mutual TLS
Previously, client keypair had needed to be specified even when unused.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-08-10 21:48:03 +09:00
Lantao Liu
d64fa3b6b8 Remove extra roundtrip for checking schema1.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-09 18:47:40 -07:00
Lantao Liu
005f9f7378 Consider endpoint path when checking default host.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-09 18:22:08 -07:00
Lantao Liu
2fd69f0b78 Move config validation into pkg/config and add unit test.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-09 14:39:30 -07:00
Lantao Liu
53e94c6753 Use containerd registry mirror library.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-09 14:39:30 -07:00
Michael Crosby
d085d9b464 Remove encryption code from containerd core
We are separating out the encryption code and have designed a few new
interfaces and APIs for processing content streams.  This keep the core
clean of encryption code but enables not only encryption but support of
multiple content types ( custom media types ).

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-09 15:01:16 +00:00
Alex Price
3353ab76d9 Add flag to overload default privileged host device behaviour
This commit adds a flag to the runtime config that allows overloading of the default
privileged behaviour. When the flag is enabled on a runtime, host devices won't
be appended to the runtime spec if the container is run as privileged.

By default the flag is false to maintain the current behaviour of privileged.

Fixes #1213

Signed-off-by: Alex Price <aprice@atlassian.com>
2019-08-08 12:16:42 +10:00
Lantao Liu
95bd02d28f
Merge pull request #1200 from jterry75/image_user
Assign ImageSpec User if SecurityContext is not set
2019-08-07 13:50:08 -07:00
Lantao Liu
8ea0cc90aa
Merge pull request #1221 from jterry75/log_g
Switch to containerd/log package
2019-08-07 13:49:33 -07:00
Justin Terry (VM)
bc2cff625b Assign ImageSpec User if SecurityContext is not set
By default the SecurityContext for Container activation can contain a Username
UID, GID. The order of precedences is username, UID, GID. If none of these
options are specified as a last resort attempt to set the ImageSpec username.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-08-07 12:20:52 -07:00
Justin Terry (VM)
193918b702 Switch to containerd/log package
Moves to the containerd/log package over logrus directly. This benefits the
traces because if using any log context such as OpenCensus on the entry gRPC
API all traces for that gRPC method will now contain the appropriate TraceID,
SpanID for easy correlation.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-08-07 12:18:18 -07:00
Lantao Liu
eae5fc360f Infer systemd cgroup based on path suffix.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-06 11:00:51 -07:00
Lantao Liu
871a8b89c8 Do not deprecate no_pivot yet.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-05 15:12:50 -07:00
Lantao Liu
986d04aec1 Add test for disable_proc_mount.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-02 11:22:34 -07:00
Phil Estes
f0821348b4
Merge pull request #3475 from stefanberger/gpg2-passphrase-via-file
ECI: gpg: Pass the passphrase to the gpg2 tool using a pipe
2019-08-02 13:59:17 -04:00
Lantao Liu
b74653b821 Print warning message for deprecated options.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-02 01:10:11 -07:00
Lantao Liu
f636fb0519
Merge pull request #1215 from Random-Liu/update-kubernetes
Update kubernetes
2019-08-01 10:28:25 -07:00
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
Lantao Liu
467f9e0e8a Fix proc mount support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-31 17:11:15 -07:00
Stefan Berger
5cf79913e4 gpg: Use a Pipe() rather than a file
Use a Pipe() rather than a file to pass the passphrase to the command
line tool. Pass the file descriptor to read the passphrase from as fd '3'.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-31 16:07:25 -04:00
Stefan Berger
6a25128791 gpg: Pass the passphrase to the gpg2 tool using a file
Rather than passing the passphrase via command line write it into
a temp. file and pass the name of the file using passphrase-file option.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-31 16:07:25 -04:00
Kevin Parsons
b16e7c5de1 Update pkg/ttrpcutil with improved pipe dial logic
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-07-30 18:46:36 -07:00
Mike Brown
b23e2cf9d1
Merge pull request #1212 from mrIncompetent/return-annotations-bandwith-error
Return actual error when fetching the bandwidth info from annotation fails
2019-07-29 13:39:51 -05:00
Henrik Schmidt
9aec38164d Return actual error when fetching the bandwidth info from annotation fails
Signed-off-by: mrIncompetent <henrik@henrik-schmidt.de>
2019-07-28 09:47:31 +02:00
Lantao Liu
c78caf902d Add max concurrent downloads support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-26 18:15:17 -07:00
Lantao Liu
d3cacff8e1 Move context cancel into defer.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-25 15:00:43 -07:00
Lantao Liu
74d2b6947c
Merge pull request #1152 from jterry75/deadline_exceeded
Return gRPC codes.DeadlineExceeded for all timeout operations
2019-07-25 14:58:29 -07:00
Mike Brown
d2986eb5aa
Merge pull request #1187 from alculquicondor/feature/tcp
Add option to register on TCP server
2019-07-25 16:36:05 -05:00
Aldo Culquicondor
4b43303203 Add option to register on TCP server
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-07-25 09:42:49 -04:00
Brandon Lum
3d1fa69694 Implemented constructors for both encryption and decryption
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-24 22:19:39 -04:00
Brandon Lum
05a2b63e84 Create CryptoConfig constructors in place of dcparameters
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-24 21:51:47 -04:00
Lantao Liu
fe0cb22026 Do not cache image handler.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-24 15:38:18 -07:00
Stefan Berger
364de4c35d Wrap creation of CryptoConfig in constructors
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-23 19:53:23 -04:00
Derek McGowan
dde436e65b Crypto library movement and changes to content helper interfaces
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-07-17 15:21:29 -04:00
Justin Terry (VM)
7b0c78bacd ExecSync should block unless client context is canceled
A call to ExecSync should only return if the client context was canceled or
exceeded. The Timeout parameter to ExecSyncRequest is now used to send SIGKILL
if the exec'd process does not exit within Timeout but all paths wait for the
exec to exit.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-07-16 09:47:55 -07:00
Justin Terry (VM)
71cecedc44 StopContainer should block unless client context is canceled
A call to StopContainer should only return if the client context is canceled or
its deadline was exceeded. The Timeout parameter on StopContainerRequest is now
used as the time AFTER sending the stop signal before the SIGKILL is delivered.
The call will remain until the container has exited or the client context has
finished.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-07-16 09:44:23 -07:00
Justin Terry (VM)
d7c3ecd0fb RunPodSandbox should block unless client context is canceled
A call to RunPodSandbox should only return timeout if the operation has timed
out because the clients context deadline was exceeded. On client cancelation
it should return gRPC Canceled otherwise it should block until the sandbox has
exited.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-07-16 09:35:56 -07:00
Maksym Pavlenko
ef7f46eb7b Fix linter errors
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-14 20:49:40 -07:00
Michael Crosby
6601b406b7 Refactor runtime code for code sharing
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-08 11:47:53 -04:00
Justin Terry (VM)
cfeb2fed81 Return gRPC errors from instrumetedService
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-06-19 10:11:18 -07:00
Lantao Liu
bb020275cb
Merge pull request #1170 from Random-Liu/remove-ctr-cri-load
Remove ctr cri load
2019-06-12 14:41:49 -07:00
Lantao Liu
4a417fb083
Merge pull request #1171 from Random-Liu/add-http-proxy-support
Fix http proxy ENV when TLS is enabled.
2019-06-12 14:40:58 -07:00
Lantao Liu
322cd48965 Remove load image support
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-06-12 11:14:11 -07:00
Lantao Liu
55e5ce0e95 Fix http client when TLS is enabled.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-06-12 11:09:53 -07:00
Lantao Liu
78b4a39f5b
Merge pull request #1163 from Random-Liu/config-v2
Use the new v2 config
2019-06-12 10:29:11 -07:00
Lantao Liu
b3f733f0ad
Merge pull request #1166 from mikebrow/doc-cni-maxnum
doc update for cni max num
2019-06-11 10:55:28 -07:00
Mike Brown
3ba04c01cc doc update for cni max num
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2019-06-11 08:35:22 -05:00
Lantao Liu
150232325e Use v2 config.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-06-10 20:51:18 -07:00
Lantao Liu
66d1870d25 Add cri managed image label when pulling the image.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-06-10 15:13:38 -07:00
Lantao Liu
53c71e2b10
Merge pull request #1155 from kuramal/cni_plugin_conf_file_max_num
add cni plugin config file max num config
2019-06-10 10:14:35 -07:00
Mike Brown
bc3b49efdf
Merge pull request #1160 from Random-Liu/remove-unused-todo
Remove an unused TODO.
2019-06-10 16:21:42 +02:00
kuramal
b022de5f37 add cni plugin config file max num config, set go-cni to commit 22460c0
Signed-off-by: kuramal <linxxnil@126.com>
2019-06-10 12:14:35 +08:00
Lantao Liu
770621fe7a
Merge pull request #1158 from mikebrow/cni-debug-update
adds cni config data to the cri status/info
2019-06-07 16:46:04 -07:00
Lantao Liu
09f83a337f Remove an unused TODO.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-06-07 15:42:04 -07:00
Vlad Ungureanu
60a58af376 Add TLS auth registry support
Signed-off-by: Vlad Ungureanu <ungureanuvladvictor@gmail.com>
2019-06-06 14:55:53 -07:00
Mike Brown
b87c0d74a5 adds cni config data to the cri status/info
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2019-06-05 16:39:45 -05:00
Justin Terry (VM)
b8ea1fa177 Minor typo in toCNIBandWidth
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-30 11:51:10 -07:00
Lantao Liu
35e9f39991
Merge pull request #1151 from johscheuer/add-bandwidth-capability
Initial support for traffic shaping
2019-05-30 10:28:06 -07:00
Johannes M. Scheuermann
5e2e7c6f7d Correct Egress limits and remove unnecessary check
Signed-off-by: Johannes M. Scheuermann <joh.scheuer@gmail.com>
2019-05-30 11:44:05 +02:00
Johannes M. Scheuermann
4f0948eed5 Remove capitalized letter in error message
Signed-off-by: Johannes M. Scheuermann <joh.scheuer@gmail.com>
2019-05-29 08:20:21 +02:00
Lantao Liu
d257c16dbc Make sure exec process is killed when context is canceled.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-28 12:25:03 -07:00
Justin Terry (VM)
f544955e4a Update parseDNSOptions maxDNSSearches in error message
Minor correctness. We should use the value of the const in the error message
instead of hard coding it in the string so if maxDNSSearches ever changes so
does the error.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-24 14:42:56 -07:00
Johannes M. Scheuermann
0d439c3474 Implement bandwidth capabilties
Signed-off-by: Johannes M. Scheuermann <joh.scheuer@gmail.com>
2019-05-24 10:29:52 +02:00
Johannes M. Scheuermann
42eb3c49af Initial support for traffic shaping
Signed-off-by: Johannes M. Scheuermann <joh.scheuer@gmail.com>
2019-05-24 09:01:02 +02:00
Derek McGowan
25daa7355c
Merge pull request #3192 from thaJeztah/bump_grpc_1.19.1
bump google.golang.org/grpc v1.20.1
2019-05-22 11:58:52 -07:00
Maksym Pavlenko
7f79fbb245 Move ttrpc client to pkg/ttrpcutil
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-05-20 16:44:49 -07:00
Lantao Liu
6e14e01307
Merge pull request #1148 from congliu01/log
Override container log path to empty if either of sandbox log directory or container log path is empty.
2019-05-14 15:50:20 -07:00
Cong Liu
fda2902f30 Validate log paths in sandbox and container config.
Only compose full container log path if neither of the paths is empty. Otherwise container won't start properly.

Signed-off-by: Cong Liu <conliu@google.com>
2019-05-14 13:46:52 -04:00
Lantao Liu
ebce49f0ea
Merge pull request #1145 from jterry75/fix_typo
Fix typo in WithoutRunMount
2019-05-12 23:55:06 -07:00
Justin Terry (VM)
8ba5c02f8f Fix typo in WithoutRunMount
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-10 13:30:22 -07:00
Lantao Liu
179ca59478
Merge pull request #1147 from jterry75/unix_to_syscall_signal
Move from unix to syscall package for SIG* signals
2019-05-10 13:14:10 -07:00
Justin Terry (VM)
c1468cdeec Move from unix to syscall package for SIG* signals
To support cross compilation for SIG* signals perfer the syscall package over
the unix package.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-10 11:50:45 -07:00
Justin Terry (VM)
bc445d7595 Forward sandbox config to PullImage request
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-10 11:35:09 -07:00
Lantao Liu
4037806184 Log failed registry mirror attempt in debug.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-08 23:56:29 -07:00
Sebastiaan van Stijn
2ed8e60fa1
bump google.golang.org/grpc v1.20.1
full diff: https://github.com/grpc/grpc-go/compare/v1.12.2...v1.20.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-05 12:39:23 -07:00
Lantao Liu
ba4a04ae70 Add DefaultRuntimeName option.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-18 11:18:25 -07:00
Lantao Liu
a5c5d55c90
Merge pull request #1133 from Random-Liu/use-wait
Use wait instead of `TaskExit`.
2019-04-18 11:10:21 -07:00
Lantao Liu
d1f9611cb0 Use wait instead of TaskExit.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-18 00:18:26 -07:00
Lantao Liu
e425bd019a Update go-cni to 891c2a41e18144b2d7921f971d6c9789a68046b2.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-10 12:07:59 -07:00
Lantao Liu
fae4f79060 Enable runc.v2 as the default runtime in test.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-03 18:47:25 -07:00
Lantao Liu
b23b406fed
Merge pull request #1102 from Random-Liu/uts-namespace-and-fix-array
Uts namespace and fix array
2019-04-01 09:22:37 -07:00
Sebastiaan van Stijn
7b397f0322
bump opencontainers/selinux to v1.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-29 01:33:35 +01:00
Lantao Liu
4b4182cf59 Do not assume there is no duplicated elements in arrays.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-28 13:05:55 -07:00
Lantao Liu
9bd49c98c6 No UTS namespace for hostnetwork.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-27 15:07:36 -07:00
Lantao Liu
8777224600
Merge pull request #1099 from Random-Liu/do-not-kill-if-cancelled
Do not SIGKILL container if container stop is cancelled.
2019-03-27 14:55:18 -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
1a0228d520 Do not SIGKILL container if container stop is cancelled.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-27 00:49:41 -07: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
25442a865c
Merge pull request #1080 from zhsj/rm-partial-docker
Use ParseSignal and AtomicWriteFile functions from containerd
2019-03-08 10:53:05 -08:00
Lantao Liu
8a0bd84b9a
Merge pull request #1056 from Random-Liu/add-sandbox-log-dir-annotation
Add an OCI annotation for sandbox log directory.
2019-03-08 01:32:38 -08:00
Shengjing Zhu
c6729fe0c4 Use ParseSignal and AtomicWriteFile functions from containerd
Containerd has its own ParseSignal and AtomicWriteFile implementation.
So there's no need to use these function from github.com/docker/docker.

Signed-off-by: Shengjing Zhu <i@zhsj.me>
2019-03-08 00:51:04 +08:00
Lantao Liu
9eabcf525e Add an OCI annotation for sandbox log directory.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-06 16:43:36 -08: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
210e80289b
Merge pull request #1055 from Random-Liu/use-right-sandbox-config
Use the correct sandbox config.
2019-02-28 13:02:39 -08:00
Lantao Liu
f2f90f6b00
Merge pull request #1060 from Random-Liu/support-stream-idle-timeout
Support stream idle timeout.
2019-02-28 10:28:27 -08:00
Lantao Liu
8222da7768 Support stream idle timeout.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-28 01:30:01 -08:00
haiyanmeng
9dea9d39f5
Add RuntimeHandler into PodSandbox and PodSandboxStatus
The upstream CRI change: https://github.com/kubernetes/kubernetes/pull/73833

Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-02-27 16:49:35 -08:00
Lantao Liu
87dba924de Use the correct sandbox config.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-22 15:37:07 -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
877c1cadc1 Include default envs from containerd.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 10:29:45 -08:00
Lantao Liu
9e2ce3494d
Merge pull request #1042 from Random-Liu/etc-hostname
Set /etc/hostname.
2019-02-12 10:15:11 -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
89717d0b63 Don't log config at info level.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 02:07:53 -08:00
Lantao Liu
089d4fbfb8 Set /etc/hostname.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-12 00:18:00 -08:00
Sebastiaan van Stijn
51affb8839
Replace util.NormalizeImageRef with reference.ParseDockerRef
Using the utility caused other project to have containerd/cri
as a dependency, only for this utility. The new `reference.ParseDockerRef`
function does the same (it's a copy of this function).

Tests were kept for now, but could be removed in future.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-07 13:22:58 +01:00
Lantao Liu
83af4dad87 Support unknown state for sandbox and container
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-05 11:56:24 -08:00
Lantao Liu
4dc6f6d0b5 Add state machine for sandbox and container
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-05 11:56:24 -08:00
Lantao Liu
bfd25c80b4 Change StateUnknown to StateInit
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-02-04 11:24:49 -08:00
Iskander (Alex) Sharipov
dfebb404cb
remove excessive []byte(s) conversion
`copy` permits using to mix `[]byte` and `string` arguments without
explicit conversion. I removed explicit conversion to make the code simpler.

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
2019-01-28 19:50:28 +03:00
Lantao Liu
4dd6735020
Merge pull request #1029 from Random-Liu/add-runtime-config-api
Add a generic runtime options api.
2019-01-24 17:36:20 -08:00
Lantao Liu
bf00de33a5
Merge pull request #1025 from JoeWrightss/patch-4
Fix some typos in comment
2019-01-24 11:17:33 -08:00
Lantao Liu
d9914c8dbd Always fallback to the new runtime options.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-24 00:59:02 -08:00
Lantao Liu
42aba00a31 Add runtime config api.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-24 00:59:02 -08:00
Lantao Liu
556b219450 Fix lint error.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-23 18:14:34 -08:00
Lantao Liu
50ac40097e Fix the log ending newline handling.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-23 17:23:13 -08:00
Wei Fu
132ee9b826 fix: linter issue
megacheck, gosimple and unused has been deprecated and subsumed by
staticcheck. And staticcheck also has been upgraded. we need to update
code for the linter issue.

close: #2945

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-01-23 22:54:51 +08:00
zhoulin xie
ae1b7ac4fd Fix some typos in comment
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-01-17 15:50:46 +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
Lantao Liu
0fa8668aa4
Merge pull request #970 from AkihiroSuda/rootless
support DisableCgroup, DisableApparmor, RestrictOOMScoreAdj
2019-01-03 10:14:22 -08:00
Lantao Liu
1fbd06479e
Merge pull request #1010 from teawater/fix_crash
Fix the issue that pod or container config file without metadata will…
2019-01-03 10:10:26 -08:00
Hui Zhu
3bfef01589 Fix the issue that pod or container config file without metadata will crash containerd
Because RunPodSandbox and CreateContainer will access metadata
without check, pod or container config file without metadata will
crash containerd.

This patch add checks to handle the issue.

Fixes: #1009

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-01-03 11:02:10 +08:00
Akihiro Suda
cd8231ab2a support DisableCgroup, DisableApparmor, RestrictOOMScoreAdj
Add following config for supporting "rootless" mode

* DisableCgroup: disable cgroup
* DisableApparmor: disable Apparmor
* RestrictOOMScoreAdj: restrict the lower bound of OOMScoreAdj

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-01-03 05:12:04 +09:00
Lantao Liu
4b4b2abb2e
Merge pull request #1000 from Random-Liu/teardown-network-after-stop
Teardown sandbox network after stop.
2019-01-02 10:04:56 -08:00
JoeWrightss
55fb3b9fce Fix return error message
Signed-off-by: JoeWrightss <zhoulin.xie@daocloud.io>
2018-12-30 18:08:04 +08:00
Lantao Liu
fbab182e5e Teardown sandbox network after stop.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-12-14 15:52:17 -08:00
Mike Brown
cd3d5c7992
Merge pull request #993 from JoeWrightss/patch-2
Fix some typo errors
2018-12-11 07:49:27 -08:00
JoeWrightss
d53bcba991 Fix some typo errors
Signed-off-by: JoeWrightss <zhoulin.xie@daocloud.io>
2018-12-11 22:13:03 +08:00
Lantao Liu
ec6a1eab11
Merge pull request #991 from Random-Liu/remove-container-lifecycle-image-dependency
Remove container lifecycle image dependency
2018-12-07 17:03:57 -08:00
Lantao Liu
515ef02473 Remove container lifecycle image ref dependency.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-12-07 10:40:21 -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
db0c4dea24
Merge pull request #984 from mikebrow/ignore-exits-with-no-id
filter events for non k8s.io namespaces
2018-12-05 00:10:41 -08:00
Mike Brown
b59dd55966 filter namespace
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-12-04 16:51:24 -06:00
Lantao Liu
de967051d4 Fix kill when shared pid namespace.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-12-04 01:53:09 -08:00
Mike Brown
f8e89f71a9 adds cni results to verbose pod info
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-11-26 15:57:00 -06:00
Lantao Liu
80554f4a85
Merge pull request #973 from Random-Liu/use-event-id
Use the `ID` field of `TaskExit` event.
2018-11-12 17:02:34 -08:00
Lantao Liu
7f1f4e7a14 Remove invalid TODO comment.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-11-12 14:34:36 -08:00
Lantao Liu
d4c825f905 Use the ID field of TaskExit event.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-11-12 14:30:27 -08:00
Lantao Liu
459e481808 Update code for golang 1.11 gofmt.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-11-07 16:08:58 -08:00
Mike Brown
1b3ff7462e removes authconfit from info log
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2018-10-29 21:17:15 -05:00
Lantao Liu
c1740d8291 Manage mount lifecycle and remove cached state
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-24 11:00:25 -07:00
Starnop
22a8777a9e refactor: setup network after get Sandbox runtime
Signed-off-by: Starnop <starnop@163.com>
2018-10-17 16:35:45 +08:00
Lantao Liu
84775d2c10 Add integration test.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-11 10:32:19 -07:00
Lantao Liu
c39f63eaf4 Teardown pod network even if the network namespace is closed
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-10 13:10:18 -07:00
Lantao Liu
70da14e4b3
Merge pull request #943 from Random-Liu/support-per-runtime-config
Support runtime specific configurations.
2018-10-09 08:09:12 -07:00
Lantao Liu
1442425f92 Support runtime specific configurations.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-08 17:17:29 -07:00
Lantao Liu
3e4cf68a3f Use Authorizer.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-08 15:16:15 -07:00
JulienBalestra
27f33cd4d6
cni result: add a debug message
Signed-off-by: JulienBalestra <julien.balestra@datadoghq.com>
2018-10-03 17:19:51 +02:00
Akihiro Suda
5349fa31df remove pkg/testutil/loopback_linux.go and use continuity/testutil/loopback
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-10-02 13:12:25 +09:00
Lantao Liu
db68300a5a Manage unmanaged images in k8s.io namespace
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-27 11:19:11 -07:00
Lantao Liu
963a01735b Add timeout for container/sandbox recover and event monitor.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-26 15:23:15 -07:00
Lantao Liu
4b45e16a4b Show runtime handler in sandbox debug info.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-16 21:27:51 -07:00
Lantao Liu
ca3b806b5c Fix addition group ids.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-13 16:31:32 -07:00
Lantao Liu
f540c2a74d Skip sctp protocol hostport mapping.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-11 16:32:15 -07:00
Lantao Liu
fe0cd3672b
Merge pull request #865 from Random-Liu/cache-image-reference
Cache image reference
2018-09-10 16:21:57 -07:00
Lantao Liu
953d67d250 Create image reference cache.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-10 11:30:52 -07: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
cfdf872493
Merge pull request #891 from tallclair/runtimehandler
Add RuntimeHandler support
2018-09-10 10:09:57 -07:00
Lantao Liu
eb3d3cfc5e Revert "Add HOSTNAME to env by default for pod containers"
This reverts commit 4c3e195db3.

Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-06 15:30:53 -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
Tim Allclair
e7189a25c3
Add RuntimeHandler support
Signed-off-by: Tim Allclair <tallclair@google.com>
2018-09-05 17:27:35 -07:00
Lantao Liu
67c0b3e5e2
Merge pull request #894 from Random-Liu/support-masked-readonly-paths
Support masked readonly paths
2018-09-05 10:32:40 -07:00
Phil Estes
4c3e195db3
Add HOSTNAME to env by default for pod containers
To match expectations of users coming from Docker engine runtime, add
the HOSTNAME to the environment of new containers in a pod.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-09-05 12:04:40 -04: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
Lantao Liu
49877571e9
Merge pull request #886 from DataDog/JulienBalestra/tls-stream
stream: can use user certificates
2018-09-03 23:35:18 -07:00
JulienBalestra
dffd0dfa0e
streaming: tls conf validation to func with tests
Signed-off-by: JulienBalestra <julien.balestra@datadoghq.com>
2018-08-30 15:10:48 +02:00
JulienBalestra
859003a940
stream: struct for x509 key pair, update the docs, error management
Signed-off-by: JulienBalestra <julien.balestra@datadoghq.com>
2018-08-28 17:22:11 +02:00
JulienBalestra
b82b524260
stream: can use user certificates
Signed-off-by: JulienBalestra <julien.balestra@datadoghq.com>
2018-08-27 19:26:14 +02:00
Lantao Liu
bca304ff3e Fix an issue that container/sandbox can't be stopped.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-08-24 18:54:08 -07:00
Lantao Liu
58eb04550d
Merge pull request #873 from miaoyq/verify-selinux-level
Verify selinux level format
2018-08-13 18:57:01 -07:00
Yanqiang Miao
a87bda08c0 update selinux to b6fa367
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2018-08-14 08:33:43 +08:00
Yanqiang Miao
415727cd9f verify selinux level format
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2018-08-14 08:33:34 +08:00