Commit Graph

49 Commits

Author SHA1 Message Date
Samuel Karp
18725f010b
integration: regression test for issue 10589
This issue was caused by a race between init exits and new exec process
tracking inside the shim. The test operates by controlling the time
between when the shim invokes "runc exec" and when the actual "runc
exec" is triggered. This allows validating that races for shim state
tracking between pre- and post-start of the exec process do not exist.

Relates to https://github.com/containerd/containerd/issues/10589

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2024-09-05 16:17:09 -07:00
Akhil Mohan
f8e0753366
remove windows check in linux_test file
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2024-08-14 14:22:03 +05:30
Henry Wang
243b803a19 Add pprof to runc-shim
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-06-20 23:12:31 +00:00
Henry Wang
d9dc2811ae fix: delete sockets on shim exit
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-05-08 21:53:39 +00:00
Derek McGowan
2ac2b9c909
Make api a Go sub-module
Allow the api to stay at the same v1 go package name and keep using a
1.x version number. This indicates the API is still at 1.x and allows
sharing proto types with containerd 1.6 and 1.7 releases.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 11:03:00 -07:00
Derek McGowan
4a45507772
Move runc options to api directory
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:00 -07:00
Maksym Pavlenko
7cf8a00c77
Run failpoints tests only for runc
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-15 12:19:31 -08:00
Derek McGowan
fb9b59a843
Switch to new errdefs package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-25 22:18:45 -08:00
Derek McGowan
dbc74db6a1
Move runtime to core/runtime
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:58:04 -08:00
Derek McGowan
6be90158cd
Move sys to pkg/sys
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:56:16 -08:00
Derek McGowan
e59f64792b
Move oci to pkg/oci
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:55:48 -08:00
Derek McGowan
44a836c9b5
Move errdefs to pkg/errdefs
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:45 -08:00
Derek McGowan
b0c3d00e98
Move cio to pkg/cio
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:27 -08:00
Derek McGowan
9456048f46
Move containers to core/containers
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:50:40 -08:00
Wei Fu
dac056fe74 integration: deflake TestIssue9103
Fixes: #9334

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-11-08 23:40:00 +08:00
rongfu.leng
a7cd49c68a expected and actual field position adjustment
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-11-07 00:20:06 +08:00
Sebastiaan van Stijn
2af6db672e
switch back from golang.org/x/sys/execabs to os/exec (go1.19)
This is effectively a revert of 2ac9968401, which
switched from os/exec to the golang.org/x/sys/execabs package to mitigate
security issues (mainly on Windows) with lookups resolving to binaries in the
current directory.

from the go1.19 release notes https://go.dev/doc/go1.19#os-exec-path

> ## PATH lookups
>
> Command and LookPath no longer allow results from a PATH search to be found
> relative to the current directory. This removes a common source of security
> problems but may also break existing programs that depend on using, say,
> exec.Command("prog") to run a binary named prog (or, on Windows, prog.exe) in
> the current directory. See the os/exec package documentation for information
> about how best to update such programs.
>
> On Windows, Command and LookPath now respect the NoDefaultCurrentDirectoryInExePath
> environment variable, making it possible to disable the default implicit search
> of “.” in PATH lookups on Windows systems.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-11-02 21:15:40 +01:00
Derek McGowan
261e01c2ac
Move client to subpackage
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 10:37:00 -07:00
Derek McGowan
5fdf55e493
Update go module to github.com/containerd/containerd/v2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-29 20:52:21 -07:00
Derek McGowan
a80606bc2d
Move plugin type definitions to containerd plugins package
The plugins packages defines the plugins used by containerd.
Move all the types and properties to this package.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-12 20:52:56 -07:00
Wei Fu
11a7751af5 *: add runc-fp as runc wrapper to inject failpoint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-02 17:44:41 +00:00
Danny Canter
e85352183e integration/client: Rework withBytesBuffers
All of the tests using this didn't need stdin/err (one of them not even
stdout), so we can just leave them "empty" and change to a withStdout
naming to make it more obvious.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-27 23:47:14 -07:00
Laura Brehm
df280942a7
integration/client: add timeout to TestShimOOMScore
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-06-09 10:10:42 +01:00
Maksym Pavlenko
07c2ae12e1 Remove v1 runctypes
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-15 09:18:16 -07:00
Maksym Pavlenko
ef516a1507 Remove runtime v1
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-15 09:18:14 -07:00
Kazuyoshi Kato
6596a70861 Use github.com/containerd/cgroups/v3 to remove gogo
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-11-14 21:07:48 +00:00
Swagat Bora
727b33c710 Retry client connection in waitForStart
Signed-off-by: Swagat Bora <sbora@amazon.com>
2022-10-19 16:24:07 +00:00
Brian Goff
b4558bedc6 Add test flag for skipping shim cgroup test
For some shims (namely github.com/cpuguy83/containerd-shim-systemd-v1),
the shim cgroup test doesn't make sense since there is only a single
shim process for the entire node.

I use these integration tests to make sure the shim is compatible with
the runc shims and generally works as expected. This will let me skip
the shim cgroup test as there is no process for the shim to stick into
the cgroup... mostly.
There is a bootstrap process as well as a PTY copier proces which do use
the shim cgroup if provided, but the test is not able to check for
those (unless we enable tty on the test, which is a bit arbitrary and
not useful).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-09-23 17:39:04 +00:00
Kazuyoshi Kato
8160a3efc3 Reduce the number of the concurrent HTTP requests in TestUserNamespaces
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-29 22:51:39 +00:00
Gabriel Adrian Samfira
4f0d5f0ee3 Enable TestContainerPTY and TestContainerUsername
Enables TestContainerPTY and TestContainerUsername on Windows.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-02-10 06:46:42 +00:00
Maksym Pavlenko
6bccd67e84 Revert shim plugin migration
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-02 10:35:15 -08:00
Maksym Pavlenko
6fa1bb4a5c Fix build after rebase
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 09:22:50 -07:00
Maksym Pavlenko
2cec3a34b1 Migrate task directory
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:01 -07:00
Maksym Pavlenko
a3d298193c Fix backward compatibility with old task shims
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:01 -07:00
Maksym Pavlenko
7c4ead285d Add task manager
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:36:58 -07:00
Claudiu Belu
830b3c26ec integration: Enable some tests for Windows (part 2)
Some of the tests that are currently running only on Linux can be made
to run on Windows with a few changes.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-07 08:13:01 -07:00
Claudiu Belu
6020189003 integration: Enable some tests for Windows
Some of the tests in containerd/integration/client/ are not
currently being run on Windows, even though they can pass.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-13 16:04:46 +03:00
Eng Zer Jun
50da673592
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-21 09:50:38 +08:00
Derek McGowan
3e72e335fe
Use github images for integration tests
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-09-20 13:35:13 -07:00
Sebastiaan van Stijn
2ac9968401
replace uses of os/exec with golang.org/x/sys/execabs
Go 1.15.7 contained a security fix for CVE-2021-3115, which allowed arbitrary
code to be executed at build time when using cgo on Windows. This issue also
affects Unix users who have “.” listed explicitly in their PATH and are running
“go get” outside of a module or with module mode disabled.

This issue is not limited to the go command itself, and can also affect binaries
that use `os.Command`, `os.LookPath`, etc.

From the related blogpost (ttps://blog.golang.org/path-security):

> Are your own programs affected?
>
> If you use exec.LookPath or exec.Command in your own programs, you only need to
> be concerned if you (or your users) run your program in a directory with untrusted
> contents. If so, then a subprocess could be started using an executable from dot
> instead of from a system directory. (Again, using an executable from dot happens
> always on Windows and only with uncommon PATH settings on Unix.)
>
> If you are concerned, then we’ve published the more restricted variant of os/exec
> as golang.org/x/sys/execabs. You can use it in your program by simply replacing

This patch replaces all uses of `os/exec` with `golang.org/x/sys/execabs`. While
some uses of `os/exec` should not be problematic (e.g. part of tests), it is
probably good to be consistent, in case code gets moved around.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-25 18:11:09 +02: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
ktock
cd33c007ce CI: Switch to available latest images
`mirror.gcr.io/library/busybox:1.32.0` is unavailable.

```console
$ curl -s https://mirror.gcr.io//v2/library/busybox/tags/list | jq '.tags'
[
  "1.26.2",
  "1.27.2",
  "1.28",
  "1.29",
  "1.29.2",
  "1.29.3",
  "1.30",
  "1.30.1",
  "1.31",
  "1.31.0",
  "1.31.1",
  "1.32",
  "latest"
]
```

`mirror.gcr.io/library/alpine:3.13` is unavailable.

```console
$ curl -s https://mirror.gcr.io//v2/library/alpine/tags/list | jq '.tags'
[
  "20200428",
  "3",
  "3.10",
  "3.11",
  "3.12",
  "3.12.0",
  "3.12.1",
  "3.13.5",
  "3.3",
  "3.4",
  "3.6",
  "3.7",
  "3.8",
  "3.9",
  "latest"
]
```

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-06-21 14:54:50 +09:00
Ma Xinjian
e1c845df50 Fix small typo
Signed-off-by: Ma Xinjian <maxj.fnst@fujitsu.com>
2021-05-24 11:49:55 +08:00
Derek McGowan
fc4da9728e Pin integration test image for alpine
The latest tag is no longer available for alpine, pin
to the latest version rather than using latest

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-05-13 14:10:59 -04:00
Sebastiaan van Stijn
1faca349ea
integration/client: rename package to "client"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-30 16:21:36 +02:00
Phil Estes
33776ada04
Use specific image for user namespaces tests
Due to the lack of an existing /proc dir in the rootfs of busybox, there
seems to be a race between the mount of /proc and whether the root dir
is already readonly? May need investigation, but for now use an image
that has a /proc dir existing.

Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-19 22:51:32 -04:00
Phil Estes
6e343f25e8
Switch test image to a non rate-limited manifest list
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-18 14:07:32 -04:00
Sebastiaan van Stijn
4e76bcf061
gofmt -s -w all the things
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-03-16 21:29:41 +01:00
Davanum Srinivas
6a4aa1e2e7
Separate go module for client tests
Will help us drop dependency to github.com/Microsoft/hcsshim/test in the
main go.mod

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-03-11 19:27:45 -05:00