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
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
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
1c4e9d0487
Merge pull request #5846 from crosbymichael/ctr-cpu.shares
2021-08-11 09:24:00 +08:00
Michael Crosby
d2f3b71468
add cpu-shares to ctr
...
This allows the cpu shares to be modified via ctr.
Signed-off-by: Michael Crosby <michael@thepasture.io >
2021-08-10 04:12:15 -04:00
Derek McGowan
6f027e38a8
Remove redundant build tags
...
Remove build tags which are already implied by the name of the file.
Ensures build tags are used consistently
Signed-off-by: Derek McGowan <derek@mcg.dev >
2021-08-05 22:27:46 -07:00
Gijs Peskens
a4f97d45da
Add ruleset=4 option
...
Signed-off-by: Gijs Peskens <gijs@peskens.net >
2021-05-25 09:17:16 +02:00
Gijs Peskens
1442fee229
Remove mountpoints not commonly mounted on FreeBSD
...
Signed-off-by: Gijs Peskens <gijs@peskens.net >
2021-05-13 21:36:53 +02:00
Gijs Peskens
de04b32430
Add copyright header & make sure compilation succeeds on all platforms
...
Signed-off-by: Gijs Peskens <gijs@peskens.net >
2021-05-10 21:49:46 +02:00
Gijs Peskens
e1fd6be7e8
Fix mounts for FreeBSD
...
Signed-off-by: Gijs Peskens <gijs@peskens.net >
2021-05-10 21:49:46 +02:00
Fu Wei
ab963e1cc1
Merge pull request #5063 from Iceber/fix-with-dev-shm-size
...
oci: fix WithDevShmSize
2021-05-06 23:48:04 +08:00
Sebastiaan van Stijn
9bc8d63c9f
cri/server: use containerd/oci instead of libcontainer/devices
...
Looks like we had our own copy of the "getDevices" code already, so use
that code (which also matches the code that's used to _generate_ the spec,
so a better match).
Moving the code to a separate file, I also noticed that the _unix and _linux
code was _exactly_ the same (baring some `//nolint:` comments), so also
removing the duplicated code.
With this patch applied, we removed the dependency on the libcontainer/devices
package (leaving only libcontainer/user).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2021-04-08 23:25:21 +02:00
Akihiro Suda
8ba8533bde
pkg/cri/opts.WithoutRunMount -> oci.WithoutRunMount
...
Move `pkg/cri/opts.WithoutRunMount` function to `oci.WithoutRunMount`
so that it can be used without dependency on CRI.
Also add `oci.WithoutMounts(dests ...string)` for generality.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp >
2021-04-07 21:25:36 +09:00
Iceber Gu
b592a4c1ec
oci: fix WithDevShmSize
...
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io >
2021-03-17 13:43:58 +08:00
Brian Goff
7776e5ef2a
Support adding devices by dir
...
This enables cases where devices exist in a subdirectory of /dev,
particularly where those device names are not portable across machines,
which makes it problematic to specify from a runtime such as cri.
Added this to `ctr` as well so I could test that the code at least
works.
Signed-off-by: Brian Goff <cpuguy83@gmail.com >
2021-03-15 16:42:23 +00:00
Derek McGowan
35eeb24a17
Fix exported comments enforcer in CI
...
Add comments where missing and fix incorrect comments
Signed-off-by: Derek McGowan <derek@mcg.dev >
2021-03-12 08:47:05 -08:00
Iceber Gu
f7f6aabfff
oci: fix superfluous slice operations
...
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io >
2021-02-26 02:35:25 +08:00
Phil Estes
757be0a090
Merge pull request #5017 from AkihiroSuda/parse-cap
...
oci.WithPrivileged: set the current caps, not the known caps
2021-02-23 09:10:57 -05:00
Akihiro Suda
51f985cb1f
oci: move cap UT to _linux_test.go
...
No substantial code change
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp >
2021-02-10 17:42:18 +09:00
Iceber Gu
d08aa4b681
oci: fix the file mode of the device
...
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io >
2021-02-10 16:37:12 +08:00
Akihiro Suda
a2d1a8a865
oci.WithPrivileged: set the current caps, not the known caps
...
This change is needed for running the latest containerd inside Docker
that is not aware of the recently added caps (BPF, PERFMON, CHECKPOINT_RESTORE).
Without this change, containerd inside Docker fails to run containers with
"apply caps: operation not permitted" error.
See kubernetes-sigs/kind 2058
NOTE: The caller process of this function is now assumed to be as
privileged as possible.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp >
2021-02-10 17:14:17 +09:00
Akihiro Suda
8a57d70a50
oci: expose getUserFromPath and getGIDFromPath
...
These functions are planned to be used for implementing `nerdctl exec --user`.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp >
2020-12-14 21:53:17 +09:00
Michael Crosby
02afa94256
Add --cpus flag to ctr
...
Signed-off-by: Michael Crosby <michael@thepasture.io >
2020-07-28 23:06:07 -04:00
Paul "TBBle" Hampson
ca15cb0d81
Fix incorrect (cut-and-paste) method comment
...
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com >
2020-07-21 19:43:08 +10:00
Kir Kolyshkin
6e638ad27a
Nit: fix use of bufio.Scanner.Err
...
The Err() method should be called after the Scan() loop, not inside it.
Found by: git grep -A3 -F '.Scan()'
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com >
2020-03-11 19:36:21 -07:00
Michael Crosby
a3ca8a0dfc
Add linux resource oci.SpecOpts
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2020-03-05 13:02:10 -05:00
Jie Hao Liao
51a6813c06
Split uid and gid user ns remapping in oci
...
Signed-off-by: Jie Hao Liao <liaojh1998@gmail.com >
2019-12-10 03:07:50 -06:00
fahedouch
afd33bce81
test add tests to spec_opts
...
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
test func WithDefaultPathEnv & WithDefaultSpecForPlatform
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
fix nil context
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
[test] TTY information && ProcessCwd
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
fix TestWithTTYSize value
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
test WithUserNamespace sets the uid and gid mappings for the task
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
format test file
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
update TestWithUserNamespace check condition
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
relaunch ci
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
improve spec_opts_test test coverage
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com >
2019-11-22 18:16:36 +01:00
Michael Crosby
a6d3f4d30b
Add device opts to ctr --privileged
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-10-10 14:23:59 -04:00
Michael Crosby
25947db049
Add support for spec generation with host devices
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-10-07 10:37:58 -04:00
yuxiaobo
a0ae24b984
Word spelling correction
...
Signed-off-by: yuxiaobo <yuxiaobogo@163.com >
2019-09-25 16:49:54 +08:00
Michael Crosby
20d3fae3db
Add Opt for modifying shm size
...
Closes #3654
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-09-18 10:20:36 -04:00
Michael Crosby
fa11147e5f
Add --env-file to ctr
...
Closes #3517
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-09-06 16:25:02 -04:00
chentanjun
8788af7f8d
modify-document-duplicate-word
...
Signed-off-by: chentanjun <2799194073@qq.com >
2019-09-05 09:10:19 +08:00
Phil Estes
bc692cc59d
Use default UNIX env when image has no environment
...
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com >
2019-08-29 10:16:24 -04:00
chentanjun
92a5b08a68
fix-grammar-mistake
...
Signed-off-by: chentanjun <2799194073@qq.com >
2019-08-28 16:10:08 +08:00
Michael Crosby
7379fa6631
Remove the process default ENV
...
With the change in #3542 it breaks $PATH handling for images becuase our
default spec always sets a PATH on the process's .Env.
This removes the default and adds an Opt to add this back.
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-08-19 18:18:58 +00:00
Yangyang
1c30d4d04c
bugfix: override image.Env with process.Env, rather than be contrary
...
Signed-off-by: Yangyang <1032120121@163.com >
2019-08-16 18:53:07 +08:00
wanghuaiqing
d8322e38c7
cast Rdev of Stat_t to uint64 for mips
...
Signed-off-by: wanghuaiqing <wanghuaiqing@loongson.cn >
2019-08-08 14:24:50 +08:00
Michael Crosby
725d3ad8cb
Add --device flag to ctr
...
Closes #3066
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-07-18 18:51:05 +00:00
Michael Crosby
dca17853d8
Add WithLinuxDevices Opt
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-07-18 17:11:14 +00:00
Lantao Liu
808b223536
Fix race and panic.
...
Signed-off-by: Lantao Liu <lantaol@google.com >
2019-03-28 01:27:13 -07:00
Michael Crosby
388c8a1760
Fastpath opt and ExecProcess loading
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-03-22 12:08:43 -04:00
Michael Crosby
bdd84abf05
Add additional capability handling opts
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-03-15 12:31:41 -04:00
Michael Crosby
84a24711e8
Add runc.v2 multi-shim
...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com >
2019-02-21 11:09:46 -05:00
Eric Hotinger
0190e5f390
Removes the oci.test.exe binary.
...
Signed-off-by: Eric Hotinger <ehotinger@gmail.com >
2019-02-07 11:55:20 -08:00
John Howard
59ea134ce1
OCI Modifiers for Windows
...
Signed-off-by: John Howard <jhoward@microsoft.com >
Needed for the containerd work on Windows and integrating the
oci package from containerd into moby.
No longer sets defaults for
- .Process.ConsoleSize
- .Windows.IgnoreFlushesDuringBoot
- .Windows.Network.AllowUnqualifiedDNSQuery
Adds helper functions and tests for
- WithWindowsIgnoreFlushesDuringBoot
- WithWindowNetworksAllowUnqualifiedDNSQuery
Updates `ctr run` on Windows to use the new helper functions,
ConsoleSize is already handled.
2019-02-06 10:44:36 -08:00
akolomentsev
1be86af108
add test for WithImageConfigArgs
...
Signed-off-by: Andrey Kolomentsev <andrey.kolomentsev@docker.com >
2018-12-20 18:15:24 -08:00
akolomentsev
f2344db40a
do not mutate defaults in replaceOrAppendEnvValues
...
Signed-off-by: Andrey Kolomentsev <andrey.kolomentsev@docker.com >
2018-12-19 16:38:22 -08:00