Commit Graph

9582 Commits

Author SHA1 Message Date
Hajime Tazaki
a43fa9f284 darwin: runtime support
This commit attemts to support containerd on darwin platform.  With an
external runtime shim, ctr run should work with, for instance,
--runtime=io.containerd.runu.v1.  An example of runtime and shim is
managed under different repository (github.com/ukontainer/runu/).

Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
2021-09-03 09:48:21 +09:00
Hajime Tazaki
5dd38792a8 darwin: use the default values for socketRoot variable
Since the /run directory on macOS is read-only, darwin containerd should
use a different directory.  Use the pre-defined default values instead
to avoid this issue.

Fixes: bd908acab ("Use path based unix socket for shims")
Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
2021-09-03 09:48:21 +09:00
Mike Brown
e00f87f1dc
Merge pull request #5927 from adelina-t/ws_2022_image_update
Update Pause image in tests & config
2021-08-31 16:11:57 -05:00
Mike Brown
4bc5ca76e7
Merge pull request #5122 from mythi/non-root-containers-and-devices-v2
cri: Devices ownership from SecurityContext
2021-08-31 16:11:18 -05:00
Adelina Tuvenie
6d3d34b85d Update Pause image in tests & config
With the introduction of Windows Server 2022, some images have been updated
to support WS2022 in their manifest list. This commit updates the test images
accordingly.

Signed-off-by: Adelina Tuvenie <atuvenie@cloudbasesolutions.com>
2021-08-31 19:42:57 +03:00
Phil Estes
44d5a7e26d
Merge pull request #5921 from ktock/fix-failed-precondition
Fix pull fails on unexpected EOF
2021-08-30 14:01:19 -04:00
Phil Estes
0d5223d700
Merge pull request #5845 from alexandref75/fix-dir-device-support
Fix dir support for devices
2021-08-30 13:59:13 -04:00
Alexandre Peixoto Ferreira
838afd2116 Adding testing of two devices
Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
2021-08-30 11:28:43 -05:00
Fu Wei
ebcf876bf7
Merge pull request #5914 from claudiubelu/windows/platform-default-match 2021-08-30 17:40:47 +08:00
Mikko Ylinen
e0f8c04dad cri: Devices ownership from SecurityContext
CRI container runtimes mount devices (set via kubernetes device plugins)
to containers by taking the host user/group IDs (uid/gid) to the
corresponding container device.

This triggers a problem when trying to run those containers with
non-zero (root uid/gid = 0) uid/gid set via runAsUser/runAsGroup:
the container process has no permission to use the device even when
its gid is permissive to non-root users because the container user
does not belong to that group.

It is possible to workaround the problem by manually adding the device
gid(s) to supplementalGroups. However, this is also problematic because
the device gid(s) may have different values depending on the workers'
distro/version in the cluster.

This patch suggests to take RunAsUser/RunAsGroup set via SecurityContext
as the device UID/GID, respectively. The feature must be enabled by
setting device_ownership_from_security_context runtime config value to
true (valid on Linux only).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-08-30 09:30:00 +03:00
Kohei Tokunaga
7bc5aa74c2 Fix pull fails on unexpected EOF
Currently, containerd doesn't restart pull when it encounters unexpected EOF of
blob strem withtout error codes.
There are cases where this lead to pull failure.
This commit tries to fix this issue.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-08-30 11:48:43 +09:00
Claudiu Belu
e2c769d6fb windows: The DefaultSpec platform should match the Default matcher
The Windows Default matcher also checks the the OS Version prefix,
however, the platforms.DefaultSpec does not include it, which means
that it won't match the matcher.

This solves the issue by adding the OS Version to the DefaultSpec.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-08-26 16:01:21 +00:00
Phil Estes
af1a0908d0
Merge pull request #5865 from dcantah/windows-pod-runasusername
Add RunAsUserName functionality for the Windows pod sandbox container
2021-08-25 22:25:14 -04:00
Fu Wei
ebe8f8c6be
Merge pull request #5899 from AkihiroSuda/runc-v1.0.2
bump up runc v1.0.2
2021-08-24 23:04:36 +08:00
Fu Wei
6fa9588531
Merge pull request #5903 from AkihiroSuda/gofmt117
Run `go fmt` with Go 1.17
2021-08-24 23:01:41 +08:00
Akihiro Suda
81317350c4
Merge pull request #5905 from thaJeztah/update_toml
go.mod: github.com/pelletier/go-toml v1.9.3
2021-08-24 01:28:07 +09:00
Daniel Canter
25644b4614 Add RunAsUserName functionality for the Windows Pod Sandbox Container
There was recent changes to cri to bring in a Windows section containing a
security context object to the pod config. Before this there was no way to specify
a user for the pod sandbox container to run as. In addition, the security context
is a field for field mirror of the Windows container version of it, so add the
ability to specify a GMSA credential spec for the pod sandbox container as well.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-08-23 07:35:22 -07:00
Akihiro Suda
e185167677
go.mod: update runc to v1.0.2
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-23 23:24:45 +09:00
Akihiro Suda
3f8ea1b6a1
update runc binary to v1.0.2
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-23 23:24:10 +09:00
Phil Estes
f43f22966d
Merge pull request #5902 from dweomer/rke2-690-on-main
cri: filter selinux xattr for image volumes
2021-08-23 09:48:10 -04:00
Sebastiaan van Stijn
4292969106
go.mod: github.com/pelletier/go-toml v1.9.3
full diff: https://github.com/pelletier/go-toml/compare/v1.8.1...v1.9.3

- v1.9.3: Clarify license and comply with Apache 2.0
- v1.9.2: Add Encoder.CompactComments to omit extra new line
- v1.9.1: Fix empty trees line counting

v1.9.0
-------------------

The highlight of this version is that the whole toml.Tree structure has been made
public in a backward compatible way. This allows everyone using v1.x to fully
access the data and metadata in the tree to extend the library.

This is hopefully the last release in the v1.x track, as go-toml v2 is the main
focus of development.

What's new

- TOML 1.0.0-rc.3
- Improved default tag for durations
- Provide Tree and treeValue public aliases
- Expose MarshalOrder
- Value string representation public function

Fixed bugs

- Do not allow T-prefix on local dates
- toml.Unmarshaler supports leaf nodes
- Fix date lexer to only support 4-digit year
- Fix ToMap for tables in mixed-type arrays
- Fix ToMap for tables in nested mixed-type arrays
- Support literal multiline marshal

Performance

- Remove date regexp
- Remove underscore regexps

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-23 15:38:29 +02:00
Akihiro Suda
d3aa7ee9f0
Run go fmt with Go 1.17
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Jacob Blain Christen
c3609ff4ca cri: filter selinux xattr for image volumes
Exclude the `security.selinux` xattr when copying content from layer
storage for image volumes. This allows for the already correct label
at the target location to be applied to the copied content, thus
enabling containers to write to volumes that they implicitly expect to be
able to write to.

- Fixes containerd/containerd#5090
- See rancher/rke2#690

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2021-08-20 23:47:24 -07:00
Phil Estes
ff2e58d114
Merge pull request #5131 from perithompson/windows-hostnetwork
Add Windows HostProcess Support
2021-08-20 14:29:37 -04:00
Phil Estes
736222dd87
Merge pull request #5897 from kzys/upgrade-golangci-lint
script: update golangci-lint from v1.38.0 and v1.36.0 to v1.42.0
2021-08-20 11:59:28 -04:00
Phil Estes
70d122b290
Merge pull request #5889 from estesp/update-go-1.17
Update to Go 1.17
2021-08-20 10:57:36 -04:00
Akihiro Suda
a6034d021f
Merge pull request #5896 from kzys/pid-order
integration: fix TestContainerPids
2021-08-20 13:36:26 +09:00
Kazuyoshi Kato
4dd5ca70fb script: update golangci-lint from v1.38.0 and v1.36.0 to v1.42.0
golint has been deprecated and replaced by revive since v1.41.0.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-08-19 16:27:16 -07:00
Kazuyoshi Kato
acb81bbdaf integration: fix TestContainerPids
task.Pids returns the task's processes, but the order is not guaranteed.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-08-19 09:56:22 -07:00
Phil Estes
9fe7bc938b
Bump integration timeout to 35 min
Go 1.17 go mod download step (used to handle the separate integration
go.mod) seems to do a lot more work/validation than prior Go releases,
requiring more time for integration runs.

Signed-off-by: Phil Estes <estesp@amazon.com>
2021-08-19 10:18:17 -04:00
Alexandre Peixoto Ferreira
7fba862648 Fix dir support for devices V3 (#4847)
Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
2021-08-19 07:18:31 -05:00
Fu Wei
a5eccab278
Merge pull request #5891 from crosbymichael/net-host-env
[ctr] add HOSTNAME env for host network
2021-08-19 00:04:37 +08:00
Michael Crosby
6f60b3016f [ctr] add HOSTNAME env for host network
Set the hostname environment var when using host networking via ctr

Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-08-18 14:42:36 +00:00
Derek McGowan
fda782a7b9
Merge pull request #5886 from AdamKorcz/fuzz11
Fuzzing: Add fuzzer
2021-08-17 09:41:50 -07:00
Derek McGowan
c076ede405
Merge pull request #5884 from adisky/add-systemd-env
Make Cgroup driver configurable in gce configure script
2021-08-17 09:40:05 -07:00
Phil Estes
f8602c3725
Update to Go 1.17
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-08-17 12:27:39 -04:00
AdamKorcz
c9b1b2fd5b Fuzzing: Add fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-17 00:08:59 +01:00
Aditi Sharma
9e1b57ca01 Add env for SystemdCgroup driver
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-08-16 17:27:55 +05:30
Phil Estes
024804b1be
Merge pull request #5878 from gjkim42/allow-expanded-dns-config
Allow expanded DNS configuration
2021-08-13 21:22:35 -04:00
Gunju Kim
1224060f89 Allow expanded DNS configuration
Signed-off-by: Gunju Kim <gjkim042@gmail.com>
2021-08-14 06:13:01 +09:00
Derek McGowan
d0be7b90f1
Merge pull request #5863 from AdamKorcz/fuzz10
Fuzzing: Add 4 fuzzers
2021-08-12 09:08:25 -07:00
AdamKorcz
538d93d2fc Fuzzing: Add 4 fuzzers
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-08-12 15:34:12 +01:00
Peri Thompson
79b369a0bb
Added windows hostProcess cni skip
Signed-off-by: Peri Thompson <perit@vmware.com>
2021-08-11 22:23:49 +01:00
Phil Estes
7d4c95ff04
Merge pull request #5813 from mxpv/shim_cleanup
Cleanup v2 shim
2021-08-11 11:47:47 -04:00
Phil Estes
159c0f04e5
Merge pull request #5840 from AdamKorcz/fuzz9
Fuzzing: Add experimental version of container fuzzer
2021-08-11 11:45:49 -04:00
Fu Wei
1c4e9d0487
Merge pull request #5846 from crosbymichael/ctr-cpu.shares 2021-08-11 09:24:00 +08:00
Derek McGowan
0fbcf9b97f
Merge pull request #5847 from kzys/master-to-main
docs: rename main to master
2021-08-10 15:06:06 -07:00
Derek McGowan
4c7338aa64
Merge pull request #5849 from kzys/lock-error-2
content: return the error with its timestamp
2021-08-10 14:39:07 -07:00
Derek McGowan
0ae2d3987b
Merge pull request #5857 from dims/fix-bad-make-protos-failure
Fix bad `make protos` failure
2021-08-10 14:32:38 -07:00
Davanum Srinivas
82fe0db9aa
Fix bad make protos failure
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-08-10 16:03:54 -04:00