Commit Graph

12739 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
03b9ce56b5
deprecate logs package, but disable linter (for transitioning)
Deprecate the pacakge, but suppress linting errors for now. This is to allow
backporting these changes to release branches, which may still need to transition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-19 08:44:35 +02:00
Sebastiaan van Stijn
d69ae811d6
alias log package to github.com/containerd/log v0.1.0
This "soft" deprecates the package, but keeps the local uses of the package,
which can make backporting this to release-branches easier (we can
still move all uses in those branches as well though).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-19 08:44:10 +02:00
Akihiro Suda
00666764b8
Merge pull request #9102 from dmcgowan/add-usage-package
Add usage package
2023-09-19 11:24:26 +09:00
Derek McGowan
ed5f7e7c8c
Update image in client to use new usage package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-18 11:20:07 -07:00
Derek McGowan
96a23ccc1d
Create new usage package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-18 11:19:22 -07:00
Phil Estes
82df7d5208
Merge pull request #9091 from thaJeztah/update_nri
vendor: github.com/containerd/nri v0.5.0
2023-09-18 10:17:06 -04:00
Akihiro Suda
a8d078cc9b
Merge pull request #9108 from BinSquare/remove-SourceDateEpochOrNow
Refactor: Removing inherently flaky and unused SourceDateEpochOrNow function.
2023-09-18 17:58:40 +09:00
BinBin He
79f781d009 Refactor: Removing inherently flaky and unused SourceDateEpochOrNow function.
Signed-off-by: BinBin He <BinSquare@users.noreply.github.com>
2023-09-17 08:34:26 -07:00
Sebastiaan van Stijn
8cbb4ea5d3
vendor: github.com/containerd/nri v0.5.0
This version no longer has a dependency on containerd, cutting
down the number of circular dependencies.

full diff: https://github.com/containerd/nri/compare/v0.4.0...v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-16 10:40:21 +02:00
Derek McGowan
31b6cdfd10
Merge pull request #8493 from DataDog/image-verifier-bindir-plugin
Add image verifier transfer service plugin system based on a binary directory
2023-09-14 06:37:17 -07:00
Phil Estes
3f315fcabf
Merge pull request #9095 from thaJeztah/isolate_platform 2023-09-14 08:31:50 -04:00
Fu Wei
fe17f65159
Merge pull request #8287 from kinvolk/rata/userns-stateless-idmap
Add support for userns in stateless and stateful pods with idmap mounts (KEP-127, k8s >= 1.27)
2023-09-14 18:14:02 +08:00
Rodrigo Campos
83240a4f77 Bump crun to 1.9
crun 1.9 was just released with fixes and exposes idmap mounts support
via the "features" sub-command.

We use that feature to throw a clear error to users (if they request
idmap mounts and the OCI runtime doesn't support it), but also to skip
tests on CI when the OCI runtime doesn't support it.

Let's bump it so the CI runs the tests with crun.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-14 11:03:15 +02:00
Rodrigo Campos
967313049f doc: Add documentation about CRI user namespaces
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 23:37:47 +02:00
Phil Estes
a831db9d35
Merge pull request #9096 from AkihiroSuda/release-remove-extra-binaries
release: remove `cri-containerd-*.tar.gz` release bundles
2023-09-13 14:23:34 -04:00
Phil Estes
25198a0557
Merge pull request #8330 from vvoland/remotes-docker-status-exists-mounted
remotes/docker: Add Mounted and Exists push status
2023-09-13 13:14:39 -04:00
Rodrigo Campos
2e13d39546 pkg/process: Only use idmap mounts if runc supports it
runc, as mandated by the runtime-spec, ignores unknown fields in the
config.json. This is unfortunate for cases where we _must_ enable that
feature or fail.

For example, if we want to start a container with user namespaces and
volumes, using the uidMappings/gidMappings field is needed so the
UID/GIDs in the volume don't end up with garbage. However, if we don't
fail when runc will ignore these fields (because they are unknown to
runc), we will just start a container without using the mappings and the
UID/GIDs the container will persist to volumes the hostUID/GID, that can
change if the container is re-scheduled by Kubernetes.

This will end up in volumes having "garbage" and unmapped UIDs that the
container can no longer change. So, let's avoid this entirely by just
checking that runc supports idmap mounts if the container we are about
to create needs them.

Please note that the "runc features" subcommand is only run when we are
using idmap mounts. If idmap mounts are not used, the subcommand is not
run and therefore this should not affect containers that don't use idmap
mounts in any way.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
Rodrigo Campos
fce1b95076 go.mod: Update runtime spec to include features.MountExtensions
Future patches will use that field.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
Rodrigo Campos
a81f80884b Revert "cri: Throw an error if idmap mounts is requested"
This reverts commit 7e6ab84884.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
Rodrigo Campos
e832605a80 integration: Simplify WithVolumeMount()
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
Rodrigo Campos
24aa808fe2 integration: Add userns test with volumes
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
Rodrigo Campos
ab5b43fe80 cri/sbserver: Pass down UID/GID mappings to OCI runtime
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
Sebastiaan van Stijn
e916d77c81
platforms: move ToProto, FromProto to api/types
These utilities resulted in the platforms package to have the containerd
API as dependency. As this package is used in many parts of the code, as
well as external consumers, we should try to keep it light on dependencies,
with the potential to make it a standalone module.

These utilities were added in f3b7436b61,
which has not yet been included in a release, so skipping deprecation
and aliases for these.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-13 16:44:52 +02:00
Sebastiaan van Stijn
381442945b
platforms: remove errdefs dependency
This cleans up the platforms package from dependencies that are not strictly
needed. This is in preparation of making this package a separate module, which
can be shared by plugins, and containerd versions (as well as external consumers),

- Remove dependency on the errdefs package: most uses of these error
  definitions were used internally, and other errors may not be useful
  for external consumers as sentinel errors.
- ErrInvalidArgument may be a potential exception, although a look at
  current uses of this package shows that there's no special handling of
  invalid parameters vs other errors (all would boil down to "the passed
  platform is invalid" (either the format, or parsing is not implemented
  on a specific platform)
- Remove uses of the convenience "Platform" alias in favor of using the
  upstream (from OCI spec). Consumers of this package can still use the
  convenience alias, but make sure that function signatures do not imply
  that it's a different type (which can cause confusion).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-13 16:44:48 +02:00
Rodrigo Campos
e0b2b17de3 cri/server: Add tests for the linux-specific parts of VolumeMounts()
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:42:31 +02:00
Rodrigo Campos
10cb112e4a cri/server: Add tests for ContainerMounts()
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:42:31 +02:00
Rodrigo Campos
97dfa7f556 cri/server: Pass down uidMappings to OCI runtime
When the kubelet sends the uid/gid mappings for a mount, just pass them
down to the OCI runtime.

OCI runtimes support this since runc 1.2 and crun 1.8.1.

And whenever we add mounts (container mounts or image spec volumes) and
userns are requested by the kubelet, we use those mappings in the mounts
so the mounts are idmapped correctly. If no userns is used, we don't
send any mappings which just keeps the current behavior.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:42:31 +02:00
Phil Estes
0f52935a53
Merge pull request #9088 from samuelkarp/nri
vendor: update github.com/containerd/nri@v0.4.0
2023-09-13 10:26:02 -04:00
Akihiro Suda
b42bdd125d
release: remove cri-containerd-*.tar.gz release bundles
The `cri-containerd-*.tar.gz` release bundles have been deprecated
since containerd v1.6.

These bundles are no longer created in the CI, however, the
corresponding Makefile targets are still kept, as they are still used by
external CIs.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-09-13 23:22:32 +09:00
Samuel Karp
39804bc3f0
Merge pull request #8909 from liggitt/fieldmask 2023-09-13 00:33:44 -07:00
Samuel Karp
9656b8c0d0
nri: update mock plugin handlers
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-09-12 17:51:27 -07:00
Samuel Karp
6f9de91efc
vendor: update github.com/containerd/nri@v0.4.0
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-09-12 16:41:05 -07:00
Phil Estes
4f691faf61
Merge pull request #9022 from dmcgowan/gc-image-collectible
gc: add support for image expiration
2023-09-12 11:07:40 -04:00
Akihiro Suda
c07cadda3e
Merge pull request #9062 from dmcgowan/add-contributors-guide
Add contributors guide
2023-09-12 15:17:40 +09:00
Derek McGowan
bf1c1042e4
Merge pull request #9083 from thaJeztah/lease_withlabel
leases: add WithLabel
2023-09-11 16:06:11 -07:00
Sebastiaan van Stijn
f7089ba225
leases: add WithLabel
This adds a new WithLabel function, which allows to set a single label on
a lease, without having to first construct an intermediate map[string]string.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-11 21:03:40 +02:00
Sebastiaan van Stijn
1480e3bd4f
leases: cleanup TestWithLabels
- don't define a type, but just an ad-hoc struct
- use a single slice with test-cases; this allows IDE's to pick up the
  table as a test-table (which allows (re-)running individual tests)
- make use of testify's assert.Equal to compare the results, instead
  of a DIY loop over the expected values.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-11 18:36:16 +02:00
Fu Wei
d015c99b2e
Merge pull request #9060 from zhuangqh/polish-criu
task: expose criu work path opt
2023-09-09 16:35:04 +08:00
Fu Wei
40f8ce622b
Merge pull request #9072 from thaJeztah/update_golang_1.21.1
update to go1.21.1, go1.20.8
2023-09-09 12:41:14 +08:00
jerryzhuang
45e303eea5 task: expose criu work path opt
Signed-off-by: jerryzhuang <zhuangqhc@gmail.com>
2023-09-09 12:13:09 +08:00
Sebastiaan van Stijn
eaf6071019
update to go1.21.1, go1.20.8
go1.21.1 (released 2023-09-06) includes four security fixes to the cmd/go,
crypto/tls, and html/template packages, as well as bug fixes to the compiler,
the go command, the linker, the runtime, and the context, crypto/tls,
encoding/gob, encoding/xml, go/types, net/http, os, and path/filepath packages.
See the Go 1.21.1 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.21.1+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.21.0...go1.21.1

From the security mailing:

[security] Go 1.21.1 and Go 1.20.8 are released

Hello gophers,

We have just released Go versions 1.21.1 and 1.20.8, minor point releases.

These minor releases include 4 security fixes following the security policy:

- cmd/go: go.mod toolchain directive allows arbitrary execution
  The go.mod toolchain directive, introduced in Go 1.21, could be leveraged to
  execute scripts and binaries relative to the root of the module when the "go"
  command was executed within the module. This applies to modules downloaded using
  the "go" command from the module proxy, as well as modules downloaded directly
  using VCS software.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2023-39320 and Go issue https://go.dev/issue/62198.

- html/template: improper handling of HTML-like comments within script contexts
  The html/template package did not properly handle HMTL-like "<!--" and "-->"
  comment tokens, nor hashbang "#!" comment tokens, in <script> contexts. This may
  cause the template parser to improperly interpret the contents of <script>
  contexts, causing actions to be improperly escaped. This could be leveraged to
  perform an XSS attack.

  Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this
  issue.

  This is CVE-2023-39318 and Go issue https://go.dev/issue/62196.

- html/template: improper handling of special tags within script contexts
  The html/template package did not apply the proper rules for handling occurrences
  of "<script", "<!--", and "</script" within JS literals in <script> contexts.
  This may cause the template parser to improperly consider script contexts to be
  terminated early, causing actions to be improperly escaped. This could be
  leveraged to perform an XSS attack.

  Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this
  issue.

  This is CVE-2023-39319 and Go issue https://go.dev/issue/62197.

- crypto/tls: panic when processing post-handshake message on QUIC connections
  Processing an incomplete post-handshake message for a QUIC connection caused a panic.

  Thanks to Marten Seemann for reporting this issue.

  This is CVE-2023-39321 and CVE-2023-39322 and Go issue https://go.dev/issue/62266.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-09 01:02:43 +02:00
Derek McGowan
210db9b101
Merge pull request #9067 from thaJeztah/update_cdi
vendor: github.com/cncf-tags/container-device-interface v0.6.1
2023-09-08 15:19:37 -07:00
Derek McGowan
1a7490c5a6
Add link to CONTRIBUTING from README
Replace link to BUILDING since CONTRIBUTING already points to it

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-08 11:18:14 -07:00
Derek McGowan
0413f12723
Add contributors guide
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-08 11:18:14 -07:00
Sebastiaan van Stijn
05093d7c07
vendor: github.com/cncf-tags/container-device-interface v0.6.1
Removes uses of the github.com/opencontainers/runc/libcontainer/devices
package.

full diff: https://github.com/cncf-tags/container-device-interface/compare/v0.6.0...v0.6.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-08 13:53:43 +02:00
Ethan Lowman
ac1d556b92
Add image verifier transfer service plugin system based on a binary directory
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
2023-09-07 18:45:02 -04:00
Jordan Liggitt
55b2df560f
go.mod: github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2
Signed-off-by: Jordan Liggitt <liggitt@google.com>
2023-09-07 16:53:10 -04:00
Jordan Liggitt
a00888db83
fix reference to canonical fieldmask type
Signed-off-by: Jordan Liggitt <liggitt@google.com>
2023-09-07 16:53:02 -04:00
Maksym Pavlenko
c13f47a3ae
Merge pull request #9029 from dmcgowan/push-inherit-distribution-sources
push: inherit distribution sources from parent
2023-09-07 12:46:18 -07:00
Derek McGowan
74e205f1e7
Merge pull request #8792 from zhuangqh/fix/writer-deadlock
content: reduce the contention between ref lock and boltdb lock
2023-09-06 09:58:07 -07:00