Commit Graph

13325 Commits

Author SHA1 Message Date
xin.li
12359559d1 reused package errdefs for not supported err
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-01-25 23:22:57 +08:00
Derek McGowan
8d9af708d7
Merge pull request #7994 from thaJeztah/re_fix_vec_aloc
pkg/cri: optimize slice initialization
2023-01-24 13:05:25 -08:00
Sebastiaan van Stijn
4f39b164f3
pkg/cri: optimize slice initialization
Some of this code was originally added in b7b1200dd3,
which likely meant to initialize the slice with a length to reduce allocations,
however, instead of initializing with a zero-length and a capacity, it
initialized the slice with a fixed length, which was corrected in commit
0c63c42f81.

This patch initializes the slice with a zero-length and expected capacity.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-24 20:46:20 +01:00
Kazuyoshi Kato
403352dd3d
Merge pull request #7987 from marquiz/devel/goresctrl
go.mod: update goresctrl to v0.3.0
2023-01-24 10:31:49 -08:00
Derek McGowan
c8736471a9
Merge pull request #7985 from jedevc/fix-push-error-propagate
pushWriter: correctly propagate errors
2023-01-24 10:30:01 -08:00
Justin Chadwell
9f6058d029 pushWriter: correctly propagate errors
In the refactor from 926b9c72f61b5be6bf8d952512f1d0932fbaf898, the error
handling was substantially reworked, and changed the types of errors
returned.

Notably, in the case of a network error, instead of propogating the
error through to return from pushWriter.Write (as previously), it would
be propagated through to pushWriter.Commit - however, this is too late,
since we've already closed the io.Pipe by the time we would have reached
this function. Therefore, we get the generic error message  "io:
read/write on closed pipe" for *every network error*.

This patch corrects this behavior to ensure that the correct error
object is always returned as early as possible, by checking the error
result after writing and detecting a closed pipe.

Additionally, we do some additional hardening - specifically we prevent
falling through when resetting the content or detecting errors, and
update the tests to explicitly check for the ErrReset message.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-01-24 11:37:41 +00:00
Markus Lehtonen
3612915596 Update vendored files
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-01-24 11:34:44 +02:00
Markus Lehtonen
d845b2a9c2 go.mod: update goresctrl to v0.3.0
Update github.com/intel/goresctrl to v0.3.0 which ontains multiple
bugfixes to rdt support.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-01-24 11:34:33 +02:00
Phil Estes
3f565daf68
Merge pull request #7968 from AkihiroSuda/ci-test-release
CI: test release.yml on every PR
2023-01-20 08:03:27 -05:00
Derek McGowan
beabd3d5d1
Merge pull request #7129 from junnplus/namespace-service
fix incorrect namespace of event when create/update namespace
2023-01-19 22:49:28 -08:00
Phil Estes
dadd203c25
Merge pull request #7973 from mxpv/backport
Backport changes to sandboxed CRI
2023-01-18 11:52:44 -05:00
Phil Estes
d45134639f
Merge pull request #7970 from Fish-pro/fix/statemant
Fix syntax errors in the document
2023-01-18 11:21:56 -05:00
Fish-pro
ac72483e87 Fix syntax errors in the document
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2023-01-18 09:59:41 +08:00
Maksym Pavlenko
f9f8455332 Backport #7393 to sbserver
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-17 14:36:21 -08:00
Maksym Pavlenko
0cbfb3375f Backport #7661 to sbserver
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-17 14:31:47 -08:00
Maksym Pavlenko
41eabf134a Backport #7685 to sbserver
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-17 14:26:16 -08:00
Maksym Pavlenko
b0d7a96976 Backport unit test from #7882 to sbserver
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-17 14:26:16 -08:00
James Jenkins
b1c5c57be0 Fix Memory Limit test
Modify the memory limit test, allowing the test to pass when swap is not
enabled.

Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
2023-01-17 13:07:28 -05:00
Phil Estes
62ffbb4b73
Merge pull request #7969 from AkihiroSuda/release-debian-frontend-noninteractive
release/Dockerfile: set DEBIAN_FRONTEND=noninteractive
2023-01-17 11:48:16 -05:00
Akihiro Suda
d1e1a16460
release/Dockerfile: set DEBIAN_FRONTEND=noninteractive
A build was hanging with `UBUNTU_VERSION=20.04`
```
...
 => [base 3/5] RUN APT-GET update &&  apt-get install -y dpkg-dev git make pkg-config                                                                            73.2s
 => => # questions will narrow this down by presenting a list of cities, representing
 => => # the time zones in which they are located.
 => => #   1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
 => => #   2. America     5. Arctic     8. Europe    11. SystemV
 => => #   3. Antarctica  6. Asia       9. Indian    12. US
 => => # Geographic area:
...

```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-17 14:37:43 +09:00
Akihiro Suda
7ddd8add46
CI: remove redundant archs from ci.yml
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-17 11:09:20 +09:00
Akihiro Suda
ffabc8a296
CI: test release.yml on every PR
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-17 11:09:19 +09:00
Samuel Karp
9e4acc0280
importer: stream oci-layout and manifest.json
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-01-13 16:14:45 -08:00
Derek McGowan
412ca496dc
Merge pull request #7963 from henry118/gc-bug
use local variable for rt when iterating collectors
2023-01-13 15:19:27 -08:00
Henry Wang
b9bd10c14e use local variable for rt when iterating collectors
Signed-off-by: Henry Wang <henwang@amazon.com>
2023-01-13 21:50:04 +00:00
Akihiro Suda
60443133da
Merge pull request #7960 from mxpv/darwin
Add basic spec and mounts for Darwin
2023-01-13 17:27:50 +09:00
Phil Estes
76585e12f5
Merge pull request #7810 from kiashok/updateShimTag
go.mod: Bump hcsshim to v0.10.0-rc.4
2023-01-12 21:46:50 -05:00
Maksym Pavlenko
1ade777c24 Add basic spec and mounts for Darwin
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-12 17:00:40 -08:00
Derek McGowan
a43d719ce2
Merge pull request #7958 from mxpv/oci
Use specs Platform instead of generated API
2023-01-12 14:31:42 -08:00
Kirtana Ashok
66eeee0439 Update hcsshim tag to v0.10.0-rc.4
Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
2023-01-12 11:29:01 -08:00
Maksym Pavlenko
3c8469a782 Use Platform instead of generated API
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-12 10:30:42 -08:00
Derek McGowan
d0893daf09
Merge pull request #7928 from mxpv/opts
Make OCI options cross-platform
2023-01-12 10:11:12 -08:00
Fu Wei
bbcfbf2189
Merge pull request #7948 from yanggangtony/go-version
update to go1.19.5, go1.18.10
2023-01-12 09:58:06 +08:00
Samuel Karp
7d14e6cf25
Merge pull request #7957 from AdamKorcz/fuzzjan23 2023-01-11 17:12:06 -08:00
AdamKorcz
802c6c5c0d fuzzing: improve archive fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2023-01-11 23:32:45 +00:00
Kazuyoshi Kato
f82ae8a922
Merge pull request #7943 from samuelkarp/shim-delete-warning
shim: enable debug logging for delete
2023-01-11 13:48:23 -08:00
Maksym Pavlenko
40be96efa9 Have separate spec builder for each platform
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:12:25 -08:00
Maksym Pavlenko
fdfa3519a3 Remove unused params from platformSpec
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:59 -08:00
Maksym Pavlenko
1c1d8fb057 Update OCI spec tests for generic platform
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:59 -08:00
Maksym Pavlenko
f43d8924e4 Move most of OCI spec options to common builder
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:59 -08:00
Maksym Pavlenko
21338d2777 Add stub to build common OCI spec
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:59 -08:00
Maksym Pavlenko
f318e5630b Update sandbox API to return target platform
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:59 -08:00
Maksym Pavlenko
dd22a3a806 Move WithMounts to specs
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:59 -08:00
Maksym Pavlenko
0ae0399b16 Make OCI spec opts available on all platforms
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-11 13:03:58 -08:00
Akihiro Suda
61617211bf
Merge pull request #7946 from mqasimsarfraz/fix-swap-tests
cri: Fix TestUpdateOCILinuxResource for host w/o swap controller
2023-01-11 18:10:09 +09:00
Samuel Karp
5f1a42543c
shim: move reap log line to debug
Fixes https://github.com/containerd/containerd/issues/7941

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-01-10 16:39:39 -08:00
Samuel Karp
515d68099b
shim: enable debug logging for delete
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-01-10 16:39:38 -08:00
yanggang
c8f4ab3b0d
update to go1.19.5, go1.18.10
Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-11 06:41:43 +08:00
Qasim Sarfraz
9c8c4508ec cri: Fix TestUpdateOCILinuxResource for host w/o swap controller
Tested on Ubuntu 20.04 w/o swap controller:
```
$ stat -fc %T /sys/fs/cgroup/
tmpfs
$ la -la /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes
ls: cannot access '/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes': No such file or directory
$  go test -v ./pkg/cri/sbserver/ -run TestUpdateOCILinuxResource
=== RUN   TestUpdateOCILinuxResource
=== RUN   TestUpdateOCILinuxResource/should_be_able_to_patch_the_unified_map
=== RUN   TestUpdateOCILinuxResource/should_be_able_to_update_each_resource
=== RUN   TestUpdateOCILinuxResource/should_skip_empty_fields
=== RUN   TestUpdateOCILinuxResource/should_be_able_to_fill_empty_fields
--- PASS: TestUpdateOCILinuxResource (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_be_able_to_patch_the_unified_map (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_be_able_to_update_each_resource (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_skip_empty_fields (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_be_able_to_fill_empty_fields (0.00s)
PASS
ok      github.com/containerd/containerd/pkg/cri/sbserver       (cached)
$ go test -v ./pkg/cri/server/ -run TestUpdateOCILinuxResource
=== RUN   TestUpdateOCILinuxResource
=== RUN   TestUpdateOCILinuxResource/should_be_able_to_update_each_resource
=== RUN   TestUpdateOCILinuxResource/should_skip_empty_fields
=== RUN   TestUpdateOCILinuxResource/should_be_able_to_fill_empty_fields
=== RUN   TestUpdateOCILinuxResource/should_be_able_to_patch_the_unified_map
--- PASS: TestUpdateOCILinuxResource (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_be_able_to_update_each_resource (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_skip_empty_fields (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_be_able_to_fill_empty_fields (0.00s)
    --- PASS: TestUpdateOCILinuxResource/should_be_able_to_patch_the_unified_map (0.00s)
PASS
ok      github.com/containerd/containerd/pkg/cri/server (cached)
```

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
2023-01-10 15:41:04 +01:00
Phil Estes
54ec1919f3
Merge pull request #7929 from Iceber/ctr_run
ctr/run: flags --detach and --rm cannot be specified together
2023-01-09 14:37:51 -05:00