Commit Graph

11820 Commits

Author SHA1 Message Date
Akihiro Suda
d8b68e3ccc
Stop using math/rand.Read and rand.Seed (deprecated in Go 1.20)
From golangci-lint:

> SA1019: rand.Read has been deprecated since Go 1.20 because it
>shouldn't be used: For almost all use cases, crypto/rand.Read is more
>appropriate. (staticcheck)

> SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative
>has been available since Go 1.0: Programs that call Seed and then expect
>a specific sequence of results from the global random source (using
>functions such as Int) can be broken when a dependency changes how
>much it consumes from the global random source. To avoid such breakages,
>programs that need a specific result sequence should use
>NewRand(NewSource(seed)) to obtain a random generator that other
>packages cannot access. (staticcheck)

See also:

- https://pkg.go.dev/math/rand@go1.20#Read
- https://pkg.go.dev/math/rand@go1.20#Seed

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:23 +09:00
Akihiro Suda
a9ac5f9cb5
lint: remove //nolint:dupword that are no longer needed
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:23 +09:00
Akihiro Suda
9b510e9a8f
lint: silence "SA1019: tar.TypeRegA has been deprecated... (staticheck)"
"SA1019: tar.TypeRegA has been deprecated since Go 1.11 and an alternative has been available since Go 1.1:
Use TypeReg instead. (staticcheck)"

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:23 +09:00
Akihiro Suda
8bf975b4fa
lint: silence "type HostFileConfig is unused (unused)"
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:22 +09:00
Akihiro Suda
4b9fd6ba5f
golangci-lint v1.51.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-16 03:50:19 +09:00
Derek McGowan
aa6418fadd
Merge pull request from GHSA-hmfx-3pcx-653p
oci: fix additional GIDs
2023-02-15 13:45:14 -08:00
Derek McGowan
583e24a1b6
Merge pull request from GHSA-259w-8hf6-59c2
importer: stream oci-layout and manifest.json
2023-02-15 13:44:49 -08:00
Kazuyoshi Kato
fe5d1d3e7c
Merge pull request #7954 from klihub/devel/sbserver-nri-integration
pkg/cri/sbserver: experimental NRI integration for CRI.
2023-02-15 10:42:25 -08:00
Kazuyoshi Kato
be10846898
Merge pull request #8114 from Fish-pro/chore/errorstart
Clean up error strings that start with uppercase
2023-02-15 10:37:47 -08:00
Phil Estes
5210e3f93f
Merge pull request #8113 from Fish-pro/chore/package1 2023-02-15 07:50:44 -05:00
Fu Wei
92af65118b
Merge pull request #8109 from AkihiroSuda/go-1.19.6 2023-02-15 18:53:34 +08:00
Zechun Chen
ac31c9a53d Clean up repeated package import
Signed-off-by: Zechun Chen <zechun.chen@daocloud.io>
2023-02-15 14:49:24 +08:00
Zechun Chen
39bac0dbef error strings should not be capitalized
Signed-off-by: Zechun Chen <zechun.chen@daocloud.io>
2023-02-15 14:30:36 +08:00
Akihiro Suda
9a9cfe85e5
Go 1.19.6
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-15 13:31:32 +09:00
Derek McGowan
4b80a2be96
Merge pull request #8052 from mxpv/grpc_shim
Initial GRPC shims support
2023-02-14 18:53:22 -08:00
Maksym Pavlenko
3548f59fd8
Merge pull request #8060 from dcantah/cri-annots-other
CRI: Pass sandbox annotations to _other platforms
2023-02-14 18:34:46 -08:00
Akihiro Suda
bf56f1a0c1
Merge pull request #8105 from fuweid/weifu/debug-for-image-snapshot
cmd/ctr/commands/images: support usage subcommand
2023-02-15 11:22:29 +09:00
Maksym Pavlenko
495e1a5ebb
Merge pull request #8067 from squeed/cni-cgroup-path
cni: pass in the cgroupPath capability argument
2023-02-14 16:06:07 -08:00
Kevin Parsons
9862f79eaa
Merge pull request #8101 from cpuguy83/loosen_windows_platform_match
Add fallback for windows platforms without osversion
2023-02-14 12:17:30 -08:00
Casey Callendrello
0166783c79 cni: pass in the cgroupPath capability argument
There is a new CNI capability argument, cgroupPath, where runtimes can
pass cgroup paths to CNI plugins.

Implement that.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
2023-02-14 16:49:29 +01:00
Casey Callendrello
d14758b605 go.mod: bump to go-cni main
Signed-off-by: Casey Callendrello <c1@caseyc.net>
2023-02-14 16:49:17 +01:00
Wei Fu
e855a59984 cmd/ctr/commands/images: support usage subcommand
The `ctr image usage` can display the usage of snapshots with a given
image ref. It's easy for user to get chain snapshot IDs and unpack
usage. And according to the [discuss][1], this subcommand can be used to
ensure if snapshot's pagecache has been discarded in a unexpected
reboot.

How to use it:

```bash
$ bin/ctr image usage --snapshotter native docker.io/library/golang:1.19.3
ctr: image docker.io/library/golang:1.19.3 isn't unpacked in snapshotter native

$ bin/ctr image usage --snapshotter overlayfs docker.io/library/golang:1.19.3
KEY                                                                     SIZE      INODES
sha256:28114d8403bac6352c3e09cb23e37208138a0cd9d309edf3df38e57be8075a1d 16.0 KiB  4
sha256:f162c02ce6b9b594757cd76eda1c1dd119b88e69e882cb645bf7ad528b54f0d2 476.2 MiB 13660
sha256:a5b9faceaa495819b9ba7011b7276c4ffaffe6c7b9de0889e11abc1113f7b5ca 225.5 MiB 3683
sha256:412b2615d27d6b0090558d25b201b60a7dff2a40892a7e7ca868b80bf5e5de41 159.8 MiB 6196
sha256:dbce1593502d39c344ce089f98187999f294de5182a7106dcb6c9d04ce0c7265 19.4 MiB  502
sha256:8953bf5d24149e9b2236abc76bd0aa14b73828f1b63e816cb4b457249f6125bc 12.2 MiB  958
sha256:ccba29d6937047c719a6c048a7038d3907590fbb8556418d119469b2ad4f95bc 134.7 MiB 7245

$ bin/ctr image usage --snapshotter overlayfs docker.io/library/golang:1.19
ctr: failed to ensure if image docker.io/library/golang:1.19 exists: image "docker.io/library/golang:1.19": not found
```

[1]: <https://github.com/containerd/containerd/issues/5854#issuecomment-1415915765>

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-14 23:24:10 +08:00
Fu Wei
ce215971d4
Merge pull request #8104 from AkihiroSuda/xx-1.2.1
release: xx v1.2.1
2023-02-14 22:41:27 +08:00
Akihiro Suda
9c82e929fd
release: xx v1.2.1
https://github.com/tonistiigi/xx/compare/v1.1.0...v1.2.1

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-14 14:25:59 +09:00
Akihiro Suda
4e2eb8ba4e
Merge pull request #7964 from dmcgowan/transfer-image-store-references
[transfer] update imagestore interface to support multiple references
2023-02-14 11:22:27 +09:00
Brian Goff
8442521645 Add fallback for windows platforms without osversion
The background for this change:

1. Windows host-process containers do not have an OS version set
2. Buildx v0.10 started pushing manifest lists by default, but it never
   has the OSVersion in the platform data (not that there is any way to
   specify what particular OS version you want). The change means that
   containerd cannot run images created with the new buildx on Windows
   because there is no matching OSVersion in the list of manifests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-02-13 23:07:06 +00:00
Kazuyoshi Kato
458fd48720
Merge pull request #8100 from mxpv/options
[sandbox] Use options to pass PodSandboxConfig to shims
2023-02-13 14:47:59 -08:00
Derek McGowan
081601f521
Update imagestore interface to support multiple references
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-02-13 13:58:33 -08:00
Danny Canter
646bc3a94e CRI: Create DefaultCRIAnnotations helper
All of the CRI sandbox and container specs all get assigned
almost the exact same default annotations (sandboxID, name, metadata,
container type etc.) so lets make a helper to return the right set for
a sandbox or regular workload container.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-02-13 13:05:01 -08:00
Danny Canter
5aab634e14 CRI: Pass sandbox annotations to _other platforms
!windows and !linux weren't getting passed the sandbox annotations.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-02-13 13:03:51 -08:00
Maksym Pavlenko
2b24af8d13 Use options to pass PodSandboxConfig to shims
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-13 12:36:20 -08:00
Krisztian Litkey
ebbcb57a4c pkg/cri/sbserver: experimental NRI integration for CRI.
Hook the NRI service plugin into CRI sbserver request
processing.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2023-02-13 22:08:18 +02:00
Krisztian Litkey
8a1dca0f4a pkg/cri: split out NRI API from pkg/cri/server.
Split out the criService-agnostic bits of nri-api* from
pkg/cri/server to pkg/cri/nri to allow sharing a single
implementation betwen the server and sbserver versions.
Rework the interfaces to not require access to package
internals.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2023-02-13 22:05:45 +02:00
Derek McGowan
edb8ebaf07
Merge pull request #8047 from ruiwen-zhao/send_nil
Send container events with nil PodSandboxStatus
2023-02-13 11:38:14 -08:00
Derek McGowan
164ac924f8
Merge pull request #7984 from aitumik/aitumik/add-host-network-tests
test: add hostNetwork tests for both windows and linux
2023-02-13 11:37:20 -08:00
Derek McGowan
34d83e1ff4
Merge pull request #8097 from helen-frank/feature/configloadPre-inspectionInAdvance
loadConfig pre-inspection in advance
2023-02-13 09:44:45 -08:00
Phil Estes
ee73e2e9fe
Merge pull request #8068 from thaJeztah/apparmor_remove_versioned
contrib/apparmor: remove version-dependent rules
2023-02-13 11:30:20 -05:00
helen
a8bb1ad2a0 loadConfig pre-inspection in advance
Signed-off-by: helen <haitao.zhang@daocloud.io>
2023-02-13 20:11:30 +08:00
Fu Wei
2654ece1d0
Merge pull request #8066 from fuweid/cleanup-blockio-init
*: introduce wrapper pkgs for blockio and rdt
2023-02-13 14:05:32 +08:00
Derek McGowan
c6cf6b2522
Merge pull request #8093 from mxpv/instrument
Extract CRI instrument into separate package
2023-02-12 21:45:13 -08:00
Maksym Pavlenko
750d18aced Extract CRI instrument package
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-12 20:49:15 -08:00
Fu Wei
040fcf85f0
Merge pull request #8091 from dcantah/mirror-generic-toml-change 2023-02-12 11:23:34 +08:00
Fu Wei
a453e92f26
Merge pull request #8092 from AkihiroSuda/typeurl-v2 2023-02-12 11:17:37 +08:00
Wei Fu
60d04b0b0f pkg: rename {blockio,rdt}_default.go -> nonlinux.go
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-12 08:35:17 +08:00
Akihiro Suda
b61988670c
go.mod: github.com/containerd/typeurl/v2 v2.1.0
Changes: https://github.com/containerd/typeurl/compare/7f6e6d160d67...v2.1.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-11 23:39:52 +09:00
Danny Canter
74b371b98a CRI: Mirror generic toml runtime config under server
In https://github.com/containerd/containerd/pull/7764 it was made
so that generic runtime options in the containerd toml config file
would get passed to shims regardless of if containerd knew of the
type beforehand and could supply the struct. However, this was only
added for the sandbox server fork here and not the regular ol' CRI
server. This change just mirrors the parts that need to be plopped in
pkg/cri/server

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-02-11 05:18:52 -08:00
Maksym Pavlenko
8ef298d863 Add transport credentials GRPC opt
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Maksym Pavlenko
77fc0948c4 Use switch when creating TTRPC/GRPC client
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Maksym Pavlenko
a82e37a5a2 Add shim bootstrap params
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Maksym Pavlenko
fc2e761e26 Initial GRPC client support
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00