Commit Graph

14496 Commits

Author SHA1 Message Date
dependabot[bot]
db437580bc
build(deps): bump github.com/opencontainers/image-spec
Bumps [github.com/opencontainers/image-spec](https://github.com/opencontainers/image-spec) from 1.1.0-rc5 to 1.1.0-rc6.
- [Release notes](https://github.com/opencontainers/image-spec/releases)
- [Changelog](https://github.com/opencontainers/image-spec/blob/main/RELEASES.md)
- [Commits](https://github.com/opencontainers/image-spec/compare/v1.1.0-rc5...v1.1.0-rc6)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/image-spec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 23:31:58 +00:00
dependabot[bot]
2c7d69530d
build(deps): bump github.com/klauspost/compress from 1.17.5 to 1.17.6
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.17.5 to 1.17.6.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.17.5...v1.17.6)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 23:30:39 +00:00
Maksym Pavlenko
da1673f55d Update vendor
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-05 11:48:16 -08:00
Maksym Pavlenko
047d42e901 Update ttrpc to v1.2.3
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-05 11:48:04 -08:00
Kirtana Ashok
64e96c7d47 Update hcsshim to v0.12.0-rc.3
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-02-05 10:42:36 -08:00
Zoe
a9060cda4a Support inject delay running with the old version (4.x) of strace for test case.
Only the newer version of strace can support `--detach-on` options
and set time duration with human readable string.

In the 4.x version of strace, using `-b` to replace `--detach-on`,
and injecting a delay with int usecs.

Signed-off-by: Zoe <hi@zoe.im>
2024-02-05 21:27:41 +08:00
Anthony Nandaa
9ef94fe528 fix(docs): fix cp and add step to include binaries in the $env:Path
This commit adds an extra (optional) step for the Windows
installation/set-up to include the containerd binaries in
the $env:Path so that later executions especially
for `ctr.exe` if needed, do not require to specify the full path.

It also further fixes the previous steps to be absolute and
also work with re-installations and upgrades.

Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
2024-02-05 11:41:45 +03:00
Fu Wei
f5e7fe0cb6
Merge pull request #9644 from abel-von/fix-sandbox-status
sandbox: fix podsandbox recover status issue
2024-02-05 07:50:34 +00:00
Samuel Karp
0125a42fb5
Merge pull request #9729 from mxpv/duration
Remove duplicated TOML duration parsers
2024-02-05 07:43:51 +00:00
Krisztian Litkey
fe24b918f6
pkg/nri, docs: enable NRI by default.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2024-02-04 11:41:56 +02:00
Abel Feng
e230ed939c sandbox: add sandbox recover ut and e2e test
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-02-04 11:55:46 +08:00
Abel Feng
3124964743 sandbox: fix recover status set issue
We can't set the status to Ready before task.Wait succeed.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-02-04 11:52:37 +08:00
Angelos Kolaitis
256637249b
Fix config import relative path glob
Previously, resolveImports would apply a glob filter if
the path contained any '*', or otherwise convert relative
paths to absolute. This meant that it was impossible to
specify globs with paths relative to the main config file.

This commit first resolves relative to absolute paths, then
applies the glob filter (if any). A test case is added to ensure
that this now works as expected.

Signed-off-by: Angelos Kolaitis <neoaggelos@gmail.com>
2024-02-03 21:03:11 +02:00
Akihiro Suda
6670695836
Revert "cri: make read-only mounts recursively read-only"
Revert PR 9713, as it appeared to break the compatibility too much
https://github.com/kubernetes/enhancements/pull/3858#issuecomment-1925441072

This reverts commit b2f254fff0.

> Conflicts:
>	internal/cri/opts/spec_linux_opts.go

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-04 01:17:14 +09:00
Justin Chadwell
a9152ebf89 copy: prevent potential deadlock if close before fully written
We also need an additional check to avoid setting both the error and
response which can create a race where they can arrive in the receiving
thread in either order.

If we hit an error, we don't need to send the response.

> There is a condition where the registry (unexpectedly, not to spec)
> returns 201 or 204 on the put before the body is fully written. I would
> expect that the http library would issue close and could fall into a
> deadlock here. We could just read respC and call setResponse. In that
> case ErrClosedPipe would get returned and Commit shouldn't be called
> anyway.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:20:11 +01:00
Justin Chadwell
b48e1141eb copy: setError should imply Close
If sending two messages from goroutine X:

	a <- 1
	b <- 2

And receiving them in goroutine Y:

	select {
	case <- a:
	case <- b:
	}

Either branch of the select can trigger first - so when we call
.setError and .Close next to each other, we don't know whether the done
channel will close first or the error channel will receive first - so
sometimes, we get an incorrect error message.

We resolve this by not sending both signals - instead, we can have
.setError *imply* .Close, by having the pushWriter call .Close on
itself, after receiving an error.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:20:11 +01:00
Justin Chadwell
e4f91c2df0 copy: remove max number of ErrResets
If a writer continually asks to be reset then it should always succeed -
it should be the responsibility of the underlying content.Writer to
stop producing ErrReset after some amount of time and to instead return
the underlying issue - which pushWriter already does today, using the
doWithRetries function.

doWithRetries already has a separate cap for retries of 6 requests (5
retries after the original failure), and it seems like this would be
previously overridden by content.Copy's max number of 5 attempts, hiding
the original error.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:20:10 +01:00
Justin Chadwell
651cfa2a2c pushWriter: refactor reset pipe logic into separate function
Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:18:05 +01:00
Justin Chadwell
9d7641ff3e copy: improve error detection from closed pipes
If we get io.ErrClosedPipe in pushWriter.Write, there are three possible
scenarios:

- The request has failed, we need to attempt a reset, so we can expect a
  new pipe incoming on pipeC.
- The request has failed, we don't need to attempt a reset, so we can
  expect an incoming error on errC.
- Something else externally has called Close, so we can expect the done
  channel to be closed.

This patch ensures that we block for as long as possible (while still
handling each of the above cases, so we avoid hanging), to make sure
that we properly return an appropriate error message each time.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:18:05 +01:00
Justin Chadwell
91a50f70b7 copy: check if writer was closed before setting a pipe
If Close is called externally before a request is attempted, then we
will accidentally attempt to send to a closed channel, causing a panic.

To avoid this, we can check to see if Close has been called, using a
done channel. If this channel is ever done, we drop any incoming errors,
requests or pipes - we don't need them, since we're done.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:18:05 +01:00
Justin Chadwell
4660f63033 copy: remove wrapping io.NopCloser from push writer pipe
io.Pipe produces a PipeReader and a PipeWriter - a close on the write
side, causes an error on both the read and write sides, while a close on
the read side causes an error on only the read side. Previously, we
explicitly prohibited closing from the read side.

However, http.Request.Body requires that "calling Close should unblock a
Read waiting for input". Our reader will not do this - calling close
becomes a no-op. This can cause a deadlock because client.Do may never
terminate in some circumstances.

We need the Reader side to close its side of the pipe as well, which it
already does using the go standard library - otherwise, we can hang
forever, writing to a pipe that will never be closed.

Allowing the requester to close the body should be safe - we never reuse
the same reader between requests, as the result of body() will never be
reused by the guarantees of the standard library.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2024-02-03 10:18:05 +01:00
Samuel Karp
96bf529cbf
Merge pull request #9742 from mxpv/envelope
Move Message proto to types
2024-02-03 06:32:01 +00:00
Derek McGowan
a896610da1
Merge pull request #9718 from jsturtevant/transfer-service-windows
Add a default differ for Windows that matches the snapshotter when using transfer service
2024-02-02 20:38:26 +00:00
Samuel Karp
1a39b91819
Merge pull request #9741 from mxpv/internal_cri
Move CRI from pkg/ to internal/
2024-02-02 19:38:44 +00:00
Maksym Pavlenko
0facc85925 Fix proto formatting
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:35:23 -08:00
Maksym Pavlenko
7f2d2c4f44 Move Message proto to types
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:35:23 -08:00
Maksym Pavlenko
2875247338 Fix formatting after moving CRI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:12:08 -08:00
Maksym Pavlenko
bbac058cf3 Move CRI from pkg/ to internal/
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:12:08 -08:00
Derek McGowan
db1e16da34
Merge pull request #9730 from thockin/main
CRI: An empty DNSConfig != unspecified
2024-02-02 17:32:45 +00:00
Tim Hockin
6e365e9250
CRI: An empty DNSConfig != unspecified
If we find that DNSConfig is provided and empty (not nil), we should not
replace it with the host's resolv.conf.

Also adds tests.

Signed-off-by: Tim Hockin <thockin@google.com>
2024-02-01 13:37:22 -08:00
Maksym Pavlenko
9340be717f
Remove duplicated TOML duration parsers
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-01 11:48:33 -08:00
Maksym Pavlenko
ac54047344
Merge pull request #9713 from AkihiroSuda/cri-rro
cri: make read-only mounts recursively read-only
2024-02-01 18:30:25 +00:00
Akihiro Suda
b2f254fff0
cri: make read-only mounts recursively read-only
Prior to this commit, `readOnly` volumes were not recursively read-only and
could result in compromise of data;
e.g., even if `/mnt` was mounted as read-only, its submounts such as
`/mnt/usbstorage` were not read-only.

This commit utilizes runc's "rro" bind mount option to make read-only bind
mounts literally read-only. The "rro" bind mount options is implemented by
calling `mount_setattr(2)` with `MOUNT_ATTR_RDONLY` and `AT_RECURSIVE`.

The "rro" bind mount options requires kernel >= 5.12, with runc >= 1.1 or
a compatible runtime such as crun >= 1.4.

When the "rro" bind mount options is not available, containerd falls back
to the legacy non-recursive read-only mounts by default.

The behavior is configurable via `/etc/containerd/config.toml`:
```toml
version = 2
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
  # treat_ro_mounts_as_rro ("Enabled"|"IfPossible"|"Disabled")
  # treats read-only mounts as recursive read-only mounts.
  # An empty string means "IfPossible".
  # "Enabled" requires Linux kernel v5.12 or later.
  # This configuration does not apply to non-volume mounts such as "/sys/fs/cgroup".
  treat_ro_mounts_as_rro = ""
```

Replaces:
- kubernetes/enhancements issue 3857
- kubernetes/enhancements PR 3858

Note: this change does not affect non-CRI clients such as ctr, nerdctl, and Docker/Moby.
RRO mounts have been supported since nerdctl v0.14 (containerd/nerdctl PR 511)
and Docker v25 (moby/moby PR 45278).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-01 09:39:36 +09:00
Akihiro Suda
0dbe758833
Merge pull request #9716 from AkihiroSuda/rocky8.9
CI: update Rocky Linux to 8.9
2024-01-31 21:28:05 +00:00
Akihiro Suda
cde08a4ff8
Merge pull request #9715 from AkihiroSuda/crun-1.14
CI: bump up crun to 1.14
2024-01-31 21:11:28 +00:00
Akihiro Suda
7ab553369f
Merge pull request #9722 from dmcgowan/update-runc-1.1.12
Update runc binary to v1.1.12
2024-01-31 21:10:57 +00:00
Akihiro Suda
27706ca4dc
Merge pull request #9721 from imba-tjd/patch-1
docs: fix typo
2024-01-31 21:10:36 +00:00
James Sturtevant
f74e5ce7e6
Move differ default to its own file
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
2024-01-31 09:54:27 -08:00
Derek McGowan
82fb589ffb
Update runc binary to v1.1.12
Update the runc binary, which includes a fix for [CVE-2024-21626].

- release notes: https://github.com/opencontainers/runc/releases/tag/v1.1.12
- full diff: https://github.com/opencontainers/runc/compare/v1.1.11...v1.1.12

[CVE-2024-21626]: https://github.com/opencontainers/runc/security/advisories/GHSA-xr7r-f8xq-vfvv

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-31 09:31:59 -08:00
谭九鼎
87a9835f16
docs: fix typo
Signed-off-by: 谭九鼎 <109224573@qq.com>
2024-01-31 21:37:48 +08:00
James Sturtevant
81409e9373
Add a default differ that matches the snapshotter
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
2024-01-30 14:34:58 -08:00
Akihiro Suda
93573f5cf3
Merge pull request #9714 from AkihiroSuda/rm-docs-cri-installation.md
rm docs/cri/installation.md
2024-01-30 20:57:37 +00:00
Akihiro Suda
2369185aac
CI: update Rocky Linux to 8.9
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-31 05:56:46 +09:00
Akihiro Suda
d8460a702a
CI: bump up crun to 1.14
Changes:
- https://github.com/containers/crun/releases/tag/1.13
- https://github.com/containers/crun/releases/tag/1.14

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-31 05:16:16 +09:00
Akihiro Suda
ebbce74230
rm docs/cri/installation.md
The file was replaced with the "Please update your bookmark" page on
Apr 1, 2022 (PR 6758).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-31 05:04:54 +09:00
Akihiro Suda
d58ec0b1ef
Merge pull request #9710 from containerd/dependabot/go_modules/github.com/google/uuid-1.6.0
build(deps): bump github.com/google/uuid from 1.5.0 to 1.6.0
2024-01-30 19:51:39 +00:00
Akihiro Suda
4e34612df7
Merge pull request #9709 from containerd/dependabot/go_modules/google.golang.org/grpc-1.61.0
build(deps): bump google.golang.org/grpc from 1.60.1 to 1.61.0
2024-01-30 19:51:21 +00:00
Phil Estes
b537ed7436
Merge pull request #9711 from containerd/dependabot/go_modules/github.com/klauspost/compress-1.17.5
build(deps): bump github.com/klauspost/compress from 1.17.4 to 1.17.5
2024-01-30 14:19:32 +00:00
Akihiro Suda
728b45d5c2
Merge pull request #9708 from containerd/dependabot/go_modules/github.com/containerd/plugin-0.1.0
build(deps): bump github.com/containerd/plugin from 0.0.0-20231101173250-7ec69893e1e7 to 0.1.0
2024-01-30 13:23:14 +00:00
Maksym Pavlenko
d558f889ca
Merge pull request #9706 from containerd/dependabot/github_actions/lycheeverse/lychee-action-1.9.3
build(deps): bump lycheeverse/lychee-action from 1.9.1 to 1.9.3
2024-01-30 04:26:37 +00:00