Commit Graph

8706 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
6be7c9f4e2
go.mod: containerd/cgroups 8a68de567b68b30602948417a7a8e99ccf00ee9b
full diff: 0b889c03f1...8a68de567b

- utils: export RunningInUserNS()
- Support updates for net_cls (adds netclsController.Update())
- Only append Hugetlb in Subsystems list when available
- dependency updates (for compatibility with recent Go versions):
    - go.mod: github.com/cilium/ebpf v0.2.0
    - go.mod: github.com/coreos/go-systemd v22.1.0
    - go.mod: sirupsen/logrus v1.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-06 13:10:35 +01:00
Derek McGowan
cfa842c278
Merge pull request #5003 from dmcgowan/prepare-1.5.0-beta.1
Prepare release notes for 1.5.0-beta.1
2021-02-05 13:51:32 -08:00
Derek McGowan
a2973c70a5
Prepare release notes for 1.5.0-beta.1
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-02-05 08:28:54 -08:00
Derek McGowan
b3f2402062
Merge pull request #5002 from crosbymichael/anno-image-name
[cri] add image-name annotation
2021-02-05 08:27:41 -08:00
Akihiro Suda
e908be5b58
Merge pull request #5001 from kzys/no-lint-upgrade 2021-02-06 00:40:38 +09:00
Akihiro Suda
d05f7bdf02
Merge pull request #5011 from thaJeztah/setup_go_v2 2021-02-06 00:39:31 +09:00
Akihiro Suda
25e42e702c
Merge pull request #5004 from thaJeztah/bump_golang 2021-02-06 00:38:48 +09:00
Sebastiaan van Stijn
129c67dc85
GHA: use setup-go@v2
https://github.com/actions/setup-go/tree/v2.1.3#v2

The V2 offers:

- Adds GOBIN to the PATH
- Proxy Support
- stable input
- Bug Fixes (including issues around version matching and semver)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-05 15:39:07 +01:00
Sebastiaan van Stijn
ec7d905f4e
Update to go 1.15.8
go1.15.8 (released 2021/02/04) includes fixes to the compiler, linker, runtime,
the go command, and the net/http package. See the Go 1.15.8 milestone on the
issue tracker for details.

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

full diff: https://github.com/golang/go/compare/go1.15.7...go1.15.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-05 12:53:25 +01:00
Akihiro Suda
5f2d02adc5
Merge pull request #4717 from thaJeztah/reduce_libcontainer_use 2021-02-05 14:28:05 +09:00
Derek McGowan
ccbeb550ba
Merge pull request #4991 from kzys/no-auto-clear
mount: setupLoop() doesn't work with with Autoclear
2021-02-04 15:00:52 -08:00
Michael Crosby
e9e3b1d6fd
Merge pull request #5000 from kzys/fix-assert-check
test: fix assert.Check's argumets to show its parameters correctly
2021-02-04 16:11:24 -05:00
Kazuyoshi Kato
07db46ee23 lint: update nolint syntax for golangci-lint
Newer golangci-lint needs explicit `//` separator. Otherwise it treats
the entire line (`staticcheck deprecated ... yet`) as a name.

https://golangci-lint.run/usage/false-positives/#nolint

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-02-04 11:59:55 -08:00
Kazuyoshi Kato
b14ccd2053 ci/gha: upgrade golangci-lint from v1.29.0 to v1.36.0
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-02-04 11:59:51 -08:00
Phil Estes
aa5e55ad98
Merge pull request #4980 from thaJeztah/prevent_cio_npe
cio: prevent NPE when closing, and fix pipes potentially not being closed on Windows
2021-02-04 14:24:10 -05:00
Phil Estes
e178af2d36
Merge pull request #4999 from thaJeztah/retry_fedora
ci/gha/fedora: retry vagrant up
2021-02-04 14:11:36 -05:00
Kazuyoshi Kato
05a2e280ac mount: make setupLoop() work with with Autoclear
setupLoop()'s Autoclear (LO_FLAGS_AUTOCLEAR) will destruct the
loopback device when all associated file descriptors are closed.

However this behavior didn't work before since setupLoop() was
returning a file name. The looppack device was destructed at
the end of the function when LoopParams had Autoclear = true.

Fixes #4969.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-02-04 11:04:04 -08:00
Kazuyoshi Kato
2ac33d79fe test: fix assert.Check's argumets to show its parameters correctly
The change I made at db6075fc2 didn't show its parameters correctly.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-02-04 10:56:58 -08:00
Sebastiaan van Stijn
f101c8ac6c
ci/gha/fedora: retry vagrant up
download.fedoraproject.org gives HTTP 404 at times,
breaking the CI. Let's give it another chance.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-04 18:21:49 +01:00
Sebastiaan van Stijn
04d061fa6a
update runc to v1.0.0-rc93
full diff: https://github.com/opencontainers/runc/compare/v1.0.0-rc92...v1.0.0-rc93

also removes dependency on libcontainer/configs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-04 16:13:30 +01:00
Sebastiaan van Stijn
54cc3483ff
pkg/cri/server: don't import libcontainer/configs
Looks like this import was not needed for the test; simplified the test
by just using the device-path (a counter would work, but for debugging,
having the list of paths can be useful).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-04 16:08:39 +01:00
Michael Crosby
99cb62f233 [cri] add image-name annotation
For some tools having the actual image name in the annotations is helpful for
debugging and auditing the workload.

Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-02-04 07:05:11 -05:00
Phil Estes
ccde82da2b
Merge pull request #4987 from Random-Liu/fix-auth-config-conversion
Fix deprecated registry auth conversion.
2021-02-03 23:29:13 -05:00
Lantao Liu
b5bf1fd5d8 Fix deprecated registry auth conversion.
Signed-off-by: Lantao Liu <lantaol@google.com>
2021-02-03 19:22:26 -08:00
Derek McGowan
40542305bf
Merge pull request #4994 from kzys/kill-before-buf
test: stop containerd before accessing the stdout
2021-02-03 15:05:41 -08:00
Kazuyoshi Kato
310e59073c test: stop containerd before accessing the stdout
The variable `buf` is connected to containerd's stdout. So, accessing
the variable before killing containerd can cause a race condition.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-02-03 10:02:32 -08:00
Phil Estes
f07e1811ef
Merge pull request #4988 from Iceber/fix-runc-v2-service
runtime: fix shutdown runc v2 service
2021-02-02 09:05:26 -05:00
IceberGu
b458583b76
runtime: fix shutdown runc v2 service
Signed-off-by: IceberGu <wei.cai-nat@daocloud.io>
2021-02-02 15:36:49 +08:00
Maksym Pavlenko
a39478ab9a
Merge pull request #4986 from kzys/devmapper-log
snapshot/devmapper: log actual values to investigate #4965
2021-02-01 18:13:07 -08:00
Kazuyoshi Kato
db6075fc24 snapshot/devmapper: log actual values to investigate #4965
This test has been flaky in GitHub Actions. This change logs the
values from devmapper to further investigate the issue.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-02-01 16:27:59 -08:00
Phil Estes
49c5c14879
Merge pull request #4906 from payall4u/bugfix/fix-open-shim-fifo
bugfix: change the flag of open log fifo to avoid containerd hang on syscall open
2021-02-01 09:01:38 -05:00
Sebastiaan van Stijn
7a468a3f3f
cio.copyIO: refactor to use cio.Close() (windows)
Use the existing `.Close()` method instead of implementing the same
logic in this function.

The defer sets `cios` to `nil` if an error occurred to preserve the
existing behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-01 11:22:08 +01:00
Sebastiaan van Stijn
219fa3d0a5
cio.copyIO: fix pipes potentially not being closed (Windows)
The defer functions were checking the local variable, and would therefore
not be executed, as the function returned if an error occurred.

Perhaps best illustrated when renaming the local variables;

    if fifos.Stdin != "" {
        l, err1 := winio.ListenPipe(fifos.Stdin, nil)
        if err1 != nil {
            return nil, errors.Wrapf(err1, "failed to create stdin pipe %s", fifos.Stdin)
        }
        defer func(l net.Listener) {
            if err1 != nil {
                l.Close()
            }
        }(l)
        // ...
    }

    if fifos.Stdout != "" {
        l, err2 := winio.ListenPipe(fifos.Stdout, nil)
        if err2 != nil {
            return nil, errors.Wrapf(err2, "failed to create stdout pipe %s", fifos.Stdout)
        }
        defer func(l net.Listener) {
            if err2 != nil {
                l.Close()
            }
        }(l)
        // ....
    }

This patch changes the function to use a named return variable, and to use
a single `defer()` that closes all pipes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-01 11:19:50 +01:00
Sebastiaan van Stijn
baf6c1d5e2
cio: openFifos() use named return variables to use in defer()
This change is mostly defensive; when checking for the returned
error, it's easy to make a mistake, and check for a "local" error,
not the actual returned error.

This patch changes the function to use a named return variable,
which is checked in the defer.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-01 11:17:54 +01:00
Sebastiaan van Stijn
6a2d3990d1
cio: FIFOSet.Close() check if FIFOSet is nill to prevent NPE
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-01 11:17:51 +01:00
payall4u
957fa3379d change flag from RDONLY to RDWR and close the fifo correct
Signed-off-by: Zhiyu Li <payall4u@qq.com>
2021-01-31 19:00:42 +08:00
Phil Estes
19ee068f93
Merge pull request #4974 from adisky/update-protobuf
Update gogo/protobuf to v1.3.2
2021-01-28 10:32:47 -05:00
Aditi Sharma
1423e9199d Update gogo/protobuf to v1.3.2
bump version 1.3.2 for gogo/protobuf due to CVE-2021-3121 discovered
in gogo/protobuf version 1.3.1, CVE has been fixed in 1.3.2

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-01-28 12:57:50 +00:00
Phil Estes
cb6f665040
Merge pull request #4975 from thaJeztah/mod_tidy
Makefile: run "go mod tidy" when vendoring
2021-01-27 11:31:13 -05:00
Sebastiaan van Stijn
6c69cd55fb
Makefile: run "go mod tidy" when vendoring
`make vendor` did not do a `go mod tidy` after vendoring, whereas
CI does this as part of the vendor validation, causing CI to fail
if `make vendor` was used to update vendoring, without doing a
`go mod tidy` as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-27 16:17:50 +01:00
Phil Estes
c28533c7a4
Merge pull request #4972 from crosbymichael/exec-sync
remove exec sync debug contents from logs
2021-01-26 16:26:43 -05:00
Michael Crosby
591d7e2fb1 remove exec sync debug contents from logs
This was dumping untrusted output to the debug logs from user containers.
We should not dump this type of information to reduce log sizes and any
information leaks from user containers.

Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-01-26 14:57:54 -05:00
Maksym Pavlenko
c28e424419
Merge pull request #4922 from kinvolk/alban_pod_annotations
cri: add annotations for pod name and namespace
2021-01-26 10:57:34 -08:00
Alban Crequy
28e4fb25f4 cri: add annotations for pod name and namespace
cri-o has annotations for pod name, namespace and container name:
https://github.com/containers/podman/blob/master/pkg/annotations/annotations.go

But so far containerd had only the container name.

This patch will be useful for seccomp agents to have a different
behaviour depending on the pod (see runtime-spec PR 1074 and runc PR
2682). This should simplify the code in:
b2d423695d/pkg/kuberesolver/kuberesolver.go (L16-L27)

Signed-off-by: Alban Crequy <alban@kinvolk.io>
2021-01-26 12:10:39 +01:00
Akihiro Suda
20346607b9
Merge pull request #4701 from kzys/content-store-filter 2021-01-25 22:35:45 +09:00
Derek McGowan
f615c58dcc
Merge pull request #4682 from fuweid/cri-handle-exit-event-separate
cri: handle sandbox/container exit event in parallel
2021-01-23 23:22:28 -08:00
Wei Fu
3299c5560d
Merge pull request #4967 from dmcgowan/cleanup-root
Move documentation and helper directories out of root
2021-01-24 15:08:19 +08:00
Maksym Pavlenko
9108373cbc
Merge pull request #4968 from dmcgowan/add-prune-references 2021-01-23 22:14:09 -08:00
Wei Fu
e56de63099 cri: handle sandbox/container exit event separately
The event monitor handles exit events one by one. If there is something
wrong about deleting task, it will slow down the terminating Pods. In
order to reduce the impact, the exit event watcher should handle exit
event separately. If it failed, the watcher should put it into backoff
queue and retry it.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-01-24 13:43:38 +08:00
Derek McGowan
9aca94c5b0
Add prune command to remove layer references
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-01-23 10:52:24 -08:00