1117 Commits
Author SHA1 Message Date
Derek McGowan 75e082c6de Merge pull request #8456 from kiashok/port_deleteCtr_1.6
[release/1.6] Remove entry for container from container store on error
2023-04-28 14:47:23 -07:00
Kirtana Ashok 95d31551d0 Remove entry for container from container store on error
If containerd does not see a container but criservice's
container store does, then we should try to recover from
this error state by removing the container from criservice's
container store as well.

Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
(cherry picked from commit d9f3e387c6)
Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
2023-04-27 05:17:33 -07:00
Kirtana Ashok 8b81d5acca Add ArgsEscaped support for CRI
This commit adds supports for the ArgsEscaped
value for the image got from the dockerfile.
It is used to evaluate and process the image
entrypoint/cmd and container entrypoint/cmd
options got from the podspec.

Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
(cherry picked from commit 8137e41c48)
Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
2023-04-17 16:56:21 -07:00
Sebastiaan van Stijn 59bdc1d5a7 go.mod: update to github.com/emicklei/go-restful/v3 v3.7.3
full diff: https://github.com/emicklei/go-restful/compare/v2.9.5...v3.7.3

- Switch to using go modules
- Add check for wildcard to fix CORS filter
- Add check on writer to prevent compression of response twice
- Add OPTIONS shortcut WebService receiver
- Add Route metadata to request attributes or allow adding attributes to routes
- Add wroteHeader set
- Enable content encoding on Handle and ServeHTTP
- Feat: support google custom verb
- Feature: override list of method allowed without content-type
- Fix Allow header not set on '405: Method Not Allowed' responses
- Fix Go 1.15: conversion from int to string yields a string of one rune
- Fix WriteError return value
- Fix: use request/response resulting from filter chain
- handle path params with prefixes and suffixes
- HTTP response body was broken, if struct to be converted to JSON has boolean value
- List available representations in 406 body
- Support describing response headers
- Unwrap function in filter chain + remove unused dispatchWithFilters

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 481fb923c5)
2023-03-15 11:59:34 -04:00
Maksym Pavlenko 9cbea6fe78 Enable dupword linter
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
(cherry picked from commit 06bfcd658c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:29:25 +01:00
Sebastiaan van Stijn f198f7724d update golangci-lint to v1.49.0
Also remove "nolint" comments for deadcode, which is deprecated, and removed
from the defaults.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8b5df7d347)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:20:57 +01:00
Sebastiaan van Stijn e6179af1ea remove unneeded nolint-comments (nolintlint), disable deprecated linters
Remove nolint-comments that weren't hit by linters, and remove the "structcheck"
and "varcheck" linters, as they have been deprecated:

    WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [linters context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f9c80be1bb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:20:57 +01:00
Sebastiaan van Stijn 95655f4cee clean-up "nolint" comments, remove unused ones
- fix "nolint" comments to be in the correct format (`//nolint:<linters>[,<linter>`
  no leading space, required colon (`:`) and linters.
- remove "nolint" comments for errcheck, which is disabled in our config.
- remove "nolint" comments that were no longer needed (nolintlint).
- where known, add a comment describing why a "nolint" was applied.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 29c7fc9520)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:11:35 +01:00
Sebastiaan van Stijn 9f0617ecc4 pkg/cri/(server|sbserver): criService.getTLSConfig() add TODO to verify nolint
This `//nolint`  was added in https://github.com/containerd/cri/commit/f5c7ac92724405806eb4e330ecab8f4350601089
to suppress warnings about the `NameToCertificate` function being deprecated:

    // Deprecated: NameToCertificate only allows associating a single certificate
    // with a given name. Leave that field nil to let the library select the first
    // compatible chain from Certificates.

Looking at that, it was deprecated in Go 1.14 through
https://github.com/golang/go/commit/eb93c684d40de4924fc0664d7d9e98a84d5a100b
(https://go-review.googlesource.com/c/go/+/205059), which describes:

    crypto/tls: select only compatible chains from Certificates

    Now that we have a full implementation of the logic to check certificate
    compatibility, we can let applications just list multiple chains in
    Certificates (for example, an RSA and an ECDSA one) and choose the most
    appropriate automatically.

    NameToCertificate only maps each name to one chain, so simply deprecate
    it, and while at it simplify its implementation by not stripping
    trailing dots from the SNI (which is specified not to have any, see RFC
    6066, Section 3) and by not supporting multi-level wildcards, which are
    not a thing in the WebPKI (and in crypto/x509).

We should at least have a comment describing why we are ignoring this, but preferably
review whether we should still use it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d215725136)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:11:35 +01:00
Abirdcfly 627f563e6d chore: remove duplicate word in comments
Signed-off-by: Abirdcfly Fu <fp544037857@gmail.com>
(cherry picked from commit dcfaa30ba2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:11:34 +01:00
Wei Fu efb88a8bbc pkg/cri/streaming: increase ReadHeaderTimeout
It is follow-up of #7254. This commit will increase ReadHeaderTimeout
from 3s to 30m, which prevent from unexpected timeout when the node is
running with high-load. 30 Minutes is longer enough to get close to
before what #7254 changes.

And ideally, we should allow user to configure the streaming server if
the users want this feature.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 460b0533b2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:11:34 +01:00
Maksym Pavlenko 584707524a Run gofmt 1.19
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
(cherry picked from commit ca3b9b50fe)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:11:33 +01:00
Kang.Zhang fc10cd23ad remove duplicate
Signed-off-by: Kang.Zhang <Kang.zhang@intel.com>
(cherry picked from commit fceab7f4c4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:11:29 +01:00
Eng Zer Jun 588ed91d3f test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
(cherry picked from commit 18ec2761c0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-08 00:00:23 +01:00
Derek McGowan 133f6bb6cd Merge pull request from GHSA-hmfx-3pcx-653p
[release/1.6] oci: fix additional GIDs
2023-02-15 13:45:14 -08:00
Bjorn Neergaard 624ff636b8 pkg/apparmor: clarify Godoc
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit d33a43cc23)
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-10 11:01:15 -07:00
Bjorn Neergaard 3a0a35b362 Revert "Don't check for apparmor_parser to be present"
This reverts commit 1acca8bba3.

As stated in the Godoc, this function is intended to check for presence
of `apparmor_parser`. Changing this regressed the public API of
containerd, and directly contradicts the way that this function is
consumed inside of containerd itself:
* https://github.com/containerd/containerd/blob/fdfdc9bfc0f865a43c88171110615d1510fad3bc/pkg/apparmor/apparmor.go#L20
* https://github.com/containerd/containerd/blob/fdfdc9bfc0f865a43c88171110615d1510fad3bc/pkg/cri/sbserver/helpers_linux.go#L85
* https://github.com/containerd/containerd/blob/fdfdc9bfc0f865a43c88171110615d1510fad3bc/pkg/cri/server/helpers_linux.go#L144

This has lead to a number of painful regressions and attempted fixes in
Moby:
* https://github.com/moby/moby/issues/44900
* https://github.com/moby/moby/pull/44902
* https://github.com/moby/moby/issues/44970

While reverting this late into the life of 1.6 and at the start of the
life of 1.7 is likely painful, I think this is ultimately the best path
to take, as containerd is subject to the same failure to start
containers with an AppArmor kernel when `apparmor_parser` is missing as
Moby.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit a3265102d9)
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-10 11:01:14 -07:00
Akihiro Suda 286a01f350 oci: fix additional GIDs
Test suite:
```yaml

---
apiVersion: v1
kind: Pod
metadata:
  name: test-no-option
  annotations:
    description: "Equivalent of `docker run` (no option)"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=0(root) gid=0(root) groups=0(root),10(wheel)" ]']
---
apiVersion: v1
kind: Pod
metadata:
  name: test-group-add-1-group-add-1234
  annotations:
    description: "Equivalent of `docker run --group-add 1 --group-add 1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=0(root) gid=0(root) groups=0(root),1(daemon),10(wheel),1234" ]']
  securityContext:
    supplementalGroups: [1, 1234]
---
apiVersion: v1
kind: Pod
metadata:
  name: test-user-1234
  annotations:
    description: "Equivalent of `docker run --user 1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=1234 gid=0(root) groups=0(root)" ]']
  securityContext:
    runAsUser: 1234
---
apiVersion: v1
kind: Pod
metadata:
  name: test-user-1234-1234
  annotations:
    description: "Equivalent of `docker run --user 1234:1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=1234 gid=1234 groups=1234" ]']
  securityContext:
    runAsUser: 1234
    runAsGroup: 1234
---
apiVersion: v1
kind: Pod
metadata:
  name: test-user-1234-group-add-1234
  annotations:
    description: "Equivalent of `docker run --user 1234 --group-add 1234`"
spec:
  restartPolicy: Never
  containers:
    - name: main
      image: ghcr.io/containerd/busybox:1.28
      args: ['sh', '-euxc',
             '[ "$(id)" = "uid=1234 gid=0(root) groups=0(root),1234" ]']
  securityContext:
    runAsUser: 1234
    supplementalGroups: [1234]
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 3eda46af12)
> Conflicts:
>	integration/addition_gids_test.go
>	pkg/cri/sbserver/container_create_linux.go
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-10 18:30:21 +09:00
Kohei Tokunaga a6544ed7dc Export remote snapshotter label handler
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
(cherry picked from commit dbf384a5a8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-06 13:22:48 +01:00
Phil Estes 4335c650c3 Merge pull request #8030 from AkihiroSuda/cherrypick-8020-1.6
[release/1.6] cri: mkdir /etc/cni with 0755, not 0700
2023-01-30 14:59:57 -05:00
Akihiro Suda ae02a24a39 cri: mkdir /etc/cni with 0755, not 0700
/etc/cni has to be readable for non-root users (0755), because /etc/cni/tuning/allowlist.conf is used for rootless mode too.
This file was introduced in CNI plugins 1.2.0 (containernetworking/plugins PR 693), and its path is hard-coded.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit b36b415526)
(cherry pick was not clean, as the sbserver is missing in the release/1.6 branch)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-31 03:22:35 +09:00
Antonio Ojea 6c6cc5ec10 add network plugin metrics
Add network plugin metrics.

The metrics are the same that were used in dockershim/kubelet until
it was deprecated in kubernetes 1.23

https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/kubelet/dockershim/network/metrics/metrics.go

Signed-off-by: Antonio Ojea <aojea@google.com>
2023-01-28 10:50:45 +00:00
Samuel Karp 8511d43698 Merge pull request #8000 from thaJeztah/1.6_backport_test_fixes 2023-01-24 23:50:33 -08:00
Sebastiaan van Stijn ab193eb20b 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>
(cherry picked from commit 4f39b164f3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-24 22:43:19 +01:00
Qasim Sarfraz 91a68edd77 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>
(cherry picked from commit 9c8c4508ec)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-24 22:05:53 +01:00
bin liu e6cf5ec58d Fix slice append error
In golang when copy a slice, if the slice is initialized with a
desired length, then appending to it will cause the size double.

Signed-off-by: bin liu <liubin0329@gmail.com>
(cherry picked from commit 0c63c42f81)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-24 20:51:24 +01:00
Danny Canter f16447e2d4 CRI: Fix no CNI info for pod sandbox on restart
Due to when we were updating the pod sandboxes underlying container
object, the pointer to the sandbox would have the right info, but
the on-disk representation of the data was behind. This would cause
the data returned from loading any sandboxes after a restart to have
no CNI result or IP information for the pod.

This change does an additional update to the on-disk container info
right after we invoke the CNI plugin so the metadata for the CNI result
and other networking information is properly flushed to disk.

Signed-off-by: Danny Canter <danny@dcantah.dev>
(cherry picked from commit 3ee6dd5c1b)
Signed-off-by: Danny Canter <danny@dcantah.dev>
2022-12-20 14:46:34 -08:00
Akihiro Suda 53c733e0ba cri: fix memory.memsw.limit_in_bytes: no such file or directory
Skip automatic `if swapLimit == 0 { s.Linux.Resources.Memory.Swap = &limit }` when the swap controller is missing.
(default on Ubuntu 20.04)

Fix issue 7828 (regression in PR 7783 "cri: make swapping disabled with memory limit")

Cherry-Pick was not cleaned, required updated cgroups library from v1.0.3 to v1.0.4

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 4157503881)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-12-19 07:53:13 -08:00
Derek McGowan 34f7cec979 Merge pull request #7820 from dmcgowan/1.6-nil-check-hugepagelimits
[release/1.6] nil check to avoid panic on upgrade
2022-12-14 12:23:16 -08:00
Mike Brown c8889dfec9 nil check to avoid panic on upgrade
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
(cherry picked from commit ce3a732709)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-12-14 11:28:04 -08:00
chaunceyjiang 0e8f5e275d fatal error: concurrent map iteration and map write
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
(cherry picked from commit 5a3a9baec9)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-12-14 11:18:08 -08:00
Qasim Sarfraz be6ef22547 cri: make swapping disabled with memory limit
OCI runtime spec defines memory.swap as 'limit of memory+Swap usage'
so setting them to equal should disable the swap. Also, this change
should make containerd behaviour same as other runtimes e.g
'cri-dockerd/dockershim' and won't be impacted when user turn on
'NodeSwap' (https://github.com/kubernetes/enhancements/issues/2400) feature.

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
(cherry picked from commit 69975b92bb)
Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
2022-12-14 14:13:56 +01:00
Danny Canter ec5acd4c15 CRI stream server: Fix goroutine leak in Exec
In the CRI streaming server, a goroutine (`handleResizeEvents`) is launched
to handle terminal resize events if a TTY is asked for with an exec; this
is the sender of terminal resize events. Another goroutine is launched
shortly after successful process startup to actually do something with
these events, however the issue arises if the exec process fails to start
for any reason that would have `process.Start` return non-nil. The receiver
goroutine never gets launched so the sender is stuck blocked on a channel send
infinitely.

This could be used in a malicious manner by repeatedly launching execs
with a command that doesn't exist in the image, as a single goroutine
will get leaked on every invocation which will slowly grow containerd's
memory usage.

Signed-off-by: Danny Canter <danny@dcantah.dev>
(cherry picked from commit f012617edf)
2022-12-07 09:18:53 -08:00
Kirtana Ashok 9fdf713e5c Added nullptr checks to pkg/cri/server and sbserver
Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
(cherry picked from commit 08d5879f32)
Signed-off-by: Kirtana Ashok <Kirtana.Ashok@microsoft.com>
2022-11-29 16:25:30 -08:00
Qasim Sarfraz 56593cca59 cri: add pod uid annotation
Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
(cherry picked from commit 0c4d32c131)
Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
2022-11-29 16:09:39 +01:00
Sophie Liu a956d84158 Add logging volume metrics to Containerd CRI plugin
Signed-off-by: Sophie Liu <sophieliu@google.com>
(cherry picked from commit 3e4449862b)
Signed-off-by: Sophie Liu <sophieliu@google.com>
2022-10-21 16:32:15 -04:00
Kazuyoshi Kato 9edb14386e Merge pull request #7551 from samuelkarp/ip-leakage-flake/1.6
[release/1.6] cri: PodSandboxStatus should tolerate missing task
2022-10-18 08:00:24 -07:00
Samuel Karp a9adc7938d cri: PodSandboxStatus should tolerate missing task
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 890398677e)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2022-10-18 00:58:10 -07:00
Paco Xu b66eb726a5 migrate from k8s.gcr.io to registry.k8s.io
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
(cherry picked from commit 9525b3148a)
Signed-off-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
2022-10-18 07:47:49 +00:00
Samuel Karp dccb15294d Merge pull request #7505 from qiutongs/backport-netns-1.6 2022-10-11 10:02:19 -07:00
Qiutong Song f2376e659f Update container with sandbox metadata after NetNS is created
Signed-off-by: Qiutong Song <songqt01@gmail.com>
(cherry picked from commit b41d6f40bb)
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2022-10-11 06:54:50 +00:00
Maksym Pavlenko 7db9d1f76f Fix linter warnings
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
(cherry picked from commit 3a3f43f72f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-05 00:00:42 +02:00
Sebastiaan van Stijn 4dc932e620 [release/1.6] gofmt with go1.19
it looks like golangci-lint's gofmt check uses go1.19 rules, despite
being run with go1.18.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-04 23:59:59 +02:00
Qiutong Song 1f29fac48e Persist container and sandbox if resource cleanup fails, like teardownPodNetwork
Signed-off-by: Qiutong Song <songqt01@gmail.com>
(cherry picked from commit 4f4aad057d)
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2022-09-30 21:19:25 +00:00
Wei Fu d89a8d2237 pkg/failpoint: add FreeBSD link and update pkg doc
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit cbebeb9440)
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2022-09-30 11:48:48 +00:00
Wei Fu 07c4794714 pkg/failpoint: add DelegatedEval API
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 1ae6e8b076)
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2022-09-30 11:48:48 +00:00
Wei Fu cb935bf49a pkg/failpoint: init failpoint package
Failpoint is used to control the fail during API call when testing, especially
the API is complicated like CRI-RunPodSandbox. It can help us to test
the unexpected behavior without mock. The control design is based on freebsd
fail(9), but simpler.

REF: https://www.freebsd.org/cgi/man.cgi?query=fail&sektion=9&apropos=0&manpath=FreeBSD%2B10.0-RELEASE

Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit ffd59ba600)
Signed-off-by: Qiutong Song <songqt01@gmail.com>
2022-09-30 02:17:51 +00:00
Iceber Gu 89e49609d3 remotes/docker/config: Skipping TLS verification for localhost
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
(cherry picked from commit 3cfde732e1)
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-09-27 16:25:59 +08:00
ruiwen-zhao 0f7e258eeb Set grpc code for unimplemented cri-api methods
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2022-09-22 20:19:46 +00:00
ruiwen-zhao ae85986151 ContainerStatus to return container resources
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2022-09-20 20:10:47 +00:00