Commit Graph

639 Commits

Author SHA1 Message Date
Fu Wei
0e7ff59098
Merge pull request #7325 from kzys/upgrade-compress 2022-08-26 21:23:00 +08:00
Kazuyoshi Kato
d063597e80 Upgrade github.com/klauspost/compress from v1.11.13 to v1.15.9
The package has multiple improvements and bug fixes.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-08-25 22:58:16 +00:00
Akihiro Suda
eb664aed0c
go.mod: github.com/opencontainers/runc v1.1.4
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-08-26 07:51:16 +09:00
zounengren
331066f87d update intergration
Signed-off-by: zounengren <zouyee1989@gmail.com>
2022-08-25 21:17:59 +08:00
Samuel Karp
36d0cfd0fd
Merge pull request #6517 from ruiwen-zhao/return-resource 2022-08-24 14:01:30 -07:00
Samuel Karp
8ce32aedd8
Merge pull request #7038 from pacoxu/registry-change 2022-08-24 13:04:13 -07:00
ruiwen-zhao
b7b1200dd3 ContainerStatus to return container resources
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2022-08-24 19:08:06 +00:00
Paco Xu
9525b3148a migrate from k8s.gcr.io to registry.k8s.io
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-08-24 13:46:46 +08:00
Kazuyoshi Kato
f318947b06 Do not rename test files on-the-fly to share functions
Instead this commit moves some functions that could be used by fuzzers.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-08-19 03:48:18 +00:00
Kazuyoshi Kato
470d3ee057 Upgrade containerd/cgroups to remove github.com/cilium/ebpf's fuzzer
The fuzzer is broken and it breaks OSS-Fuzz according to #7288.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-08-17 21:43:45 +00:00
Daniel Canter
0950447106 Remove Windows special case in TestContainerdRestart
Previously in the Windows shim, killing a task that has already exited
or a task that has not yet been started, yielded an ErrNotFound. We now
return nil, which is in line with how the linux runtime behaves, so remove
the special case we had in TestContainerdRestart for this.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-08-15 17:03:45 -07:00
Daniel Canter
1f8db2467b go.mod: Bump hcsshim to v0.10.0-rc.1
This contains quite a bit (also bumps google/uuid to 1.3.0). Some HostProcess
container improvements to get ready for whenever it goes to stable in
Kubernetes, Hyper-V (windows) container support for CRI, and a plethora of
other small additions and fixes.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-08-15 17:03:45 -07:00
ruiwen-zhao
6e4b6830f1 Update CRI-API
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2022-08-10 03:55:51 +00:00
Maksym Pavlenko
ca3b9b50fe Run gofmt 1.19
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-08-04 18:18:33 -07:00
Maksym Pavlenko
01a2b793b8
Merge pull request #7228 from mxpv/sb2
Initial sandbox API CRI integration.
2022-08-04 17:46:38 -07:00
Maksym Pavlenko
f51014f8d5 Add sandbox to in memory services
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-29 16:08:07 -07:00
Daniel Canter
b16c3e9adf Windows HostProcess container CRI stats test
Add a test to the CRI suite to validate stats functions for hostprocess
containers. hcsshim v0.9.3 had a bug in stats collection so this is
mainly for sanity and to avoid another regression.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-07-27 15:45:37 -07:00
Fu Wei
5ce1e46fa4
Merge pull request #7215 from Jenkins-J/ppc64le-cri-test-fix
Fix CRI image pull timeout test for ppc64le
2022-07-27 23:48:56 +08:00
Derek McGowan
6acde90772
Merge pull request #7069 from fuweid/failpoint-in-runc-shimv2
test: introduce failpoint control to runc-shimv2 and cni
2022-07-26 23:12:20 -07:00
Phil Estes
584110f0b6
Merge pull request #7210 from mxpv/image-list
Use image lists form integration/client tests
2022-07-26 12:09:41 -04:00
Maksym Pavlenko
2b92c70fa4 Fix command line parsing for image list
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 14:19:40 -07:00
Daniel Canter
14003683f0 go.mod: Bump hcsshim to v0.9.4
This tag contains some fixes for hostprocess containers, mainly around
fixing task stats which regressed from a change in v0.9.3.

https://github.com/microsoft/hcsshim/releases/tag/v0.9.4

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-07-25 13:24:34 -07:00
James Jenkins
1e0698e8e8 Fix CRI image pull timeout test for ppc64le
The ghcr.io/containerd/registry:2.7 image does not support the ppc64le
architecture, causing the TestCRIImagePullTimeout tests to fail when
executed on a ppc64le device.

Replace the ghcr.io/containerd/registry:2.7 image name and index with
the ghcr.io/containerd/volume-ownership:2.1 image and index in the
HoldingContentOpenWriter test.

Change the image pulled in the NoDataTransferred test to the
ghcr.io/containerd/volume-ownership:2.1 image.

Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
2022-07-25 16:11:42 -04:00
Daniel Canter
c15d8e1560 go.mod: Bump hcsshim to 0.9.3
This tag brings in a new field to fix an HNS issue in ws2019 as well as
an optimization for collecting Windows stats (memory, cpu, iops).

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-07-25 13:03:39 -07:00
Maksym Pavlenko
a9514da757 Update image references for Windows tests
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 11:04:59 -07:00
Maksym Pavlenko
2ae5f405d2 Use image lists instead of hardcoded images
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 10:54:17 -07:00
Maksym Pavlenko
552d763447 Use image lists in client tests
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 10:47:00 -07:00
Wei Fu
e6a2c07902 integration: simplify CNI-fp and add README.md
* Use delegated plugin call to simplify cni-bridge-cni
* Add README.md for cni-bridge-cni

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-24 11:45:45 +08:00
Jeff Widman
050cd58ce6 Drop deprecated ioutil
`ioutil` has been deprecated by golang. All the code in `ioutil` just
forwards functionality to code in either the `io` or `os` packages.

See https://github.com/golang/go/pull/51961 for more info.

Signed-off-by: Jeff Widman <jeff@jeffwidman.com>
2022-07-23 08:36:20 -07:00
Maksym Pavlenko
500ff95f02 Make getServicesOpts a helper
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-22 19:38:45 -07:00
Wei Fu
3c5e80b63e integration: Add injected failpoint testing for RunPodSandbox
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
be91a219c2 integration: CNI bridge wrapper with failpoint
Introduce cni-bridge-fp as CNI bridge plugin wrapper binary for CRI
testing.

With CNI `io.kubernetes.cri.pod-annotations` capability enabled, the user
can inject the failpoint setting by pod's annotation
`cniFailpointControlStateDir`, which stores each pod's failpoint setting
named by `${K8S_POD_NAMESPACE}-${K8S_POD_NAME}.json`.

When the plugin is invoked, the plugin will check the CNI_ARGS to get
the failpoint for the CNI_COMMAND from disk. For the testing, the user
can prepare setting before RunPodSandbox.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
5f9b318e50 bin/ctr,integration: new runc-shim with failpoint
Added new runc shim binary in integration testing.

The shim is named by io.containerd.runc-fp.v1, which allows us to use
additional OCI annotation `io.containerd.runtime.v2.shim.failpoint.*` to
setup shim task API's failpoint. Since the shim can be shared with
multiple container, like what kubernetes pod does, the failpoint will be
initialized during setup the shim server. So, the following the
container's OCI failpoint's annotation will not work.

This commit also updates the ctr tool that we can use `--annotation` to
specify annotations when run container. For example:

```bash
➜  ctr run -d --runtime runc-fp.v1 \
     --annotation "io.containerd.runtime.v2.shim.failpoint.Kill=1*error(sorry)" \
     docker.io/library/alpine:latest testing sleep 1d

➜  ctr t ls
TASK       PID       STATUS
testing    147304    RUNNING

➜  ctr t kill -s SIGKILL testing
ctr: sorry: unknown

➜  ctr t kill -s SIGKILL testing

➜  sudo ctr t ls
TASK       PID       STATUS
testing    147304    STOPPED
```

The runc-fp.v1 shim is based on core runc.v2. We can use it to inject
failpoint during testing complicated or big transcation API, like
kubernetes PodRunPodsandbox.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Derek McGowan
1455926416
Merge pull request #7114 from kinvolk/rata/userns-cri
Update k8s.io/cri-api to v0.25.0-alpha2
2022-07-20 13:06:58 -07:00
Akihiro Suda
f6bc986dc1
go.mod: github.com/stretchr/testify v1.8.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-07-20 08:36:10 +09:00
Derek McGowan
681aaf68b7
Merge pull request #7123 from kzys/fuzz
Copy fuzzers from github.com/cncf/cncf-fuzzing
2022-07-06 14:52:28 -07:00
Kazuyoshi Kato
b316318596 Upgrade github.com/AdaLogics/go-fuzz-headers
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-07-06 15:21:45 +00:00
Ikko Ashimine
6d4b61007b integration/client: fix typo in export_test.go
Seet -> Seek
begining -> beginning

Signed-off-by: Ikko Ashimine <eltociear@gmail.com>
2022-07-06 11:14:45 +09:00
Rodrigo Campos
b8403d2e15 Update k8s.io/cri-api to v0.25.0-alpha2
This version contains the CRI changes for user namespaces support.
Future patches will use the new fields in the CRI.

Updating the module without using the new fields doesn't cause any
behaviour change.

Updates: #7063

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-06-30 12:09:08 +02:00
Phil Estes
a44cabf517
Update go-restful/v3 to latest release
Signed-off-by: Phil Estes <estesp@amazon.com>
2022-06-29 15:23:10 -04:00
Kazuyoshi Kato
f7de1c8f90 Do not hardcode fuzzers
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Kazuyoshi Kato
2b60770c4b Move container_fuzzer.go under integration/client/
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-27 22:54:25 +00:00
Derek McGowan
99e210c50a
Move metadata plugin registration to seperate package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-06-22 17:38:41 -07:00
Kazuyoshi Kato
f91616e45e Copy FuzzConvertManifest from cncf/cncf-fuzzing
This test is one of the noisiest and should be moved from
cncf/cncf-fuzzing first.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-06-20 23:34:23 +00:00
Kazuyoshi Kato
4ec6a379c0
Merge pull request #6918 from dcantah/windows-snapshotter-cleanup
Windows snapshotter touch ups and new functionality
2022-06-10 11:08:18 -07:00
Akihiro Suda
c3fb7dfa7f
go.mod: github.com/moby/sys/mountinfo v0.6.2
https://github.com/moby/sys/compare/mountinfo/v0.6.0...mountinfo/v0.6.2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-08 13:25:08 +09:00
Kazuyoshi Kato
0532f666f6
Merge pull request #7027 from AkihiroSuda/containerd-cgroup-1.0.4
go.mod: github.com/containerd/cgroups v1.0.4
2022-06-07 20:10:33 -07:00
Akihiro Suda
5a6e4144ac
go.mod: github.com/containerd/cgroups v1.0.4
https://github.com/containerd/cgroups/compare/v1.0.3...v1.0.4

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-07 17:15:21 +09:00
Akihiro Suda
088c8df3ac
go.mod: github.com/containerd/continuity v0.3.0
https://github.com/containerd/continuity/compare/v0.2.2...v0.3.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-06-07 17:14:08 +09:00
Daniel Canter
44e12dc5d8 Windows snapshotter touch ups and new functionality
This change does a couple things to remove some cruft/unused functionality
in the Windows snapshotter, as well as add a way to specify the rootfs
size in bytes for a Windows container via a new field added in the CRI api in
k8s 1.24. Setting the rootfs/scratch volume size was assumed to be working
prior to this but turns out not to be the case.

Previously I'd added a change to pass any annotations in the containerd
snapshot form (containerd.io/snapshot/*) as labels for the containers
rootfs snapshot. This was added as a means for a client to be able to provide
containerd.io/snapshot/io.microsoft.container.storage.rootfs.size-gb as an
annotation and have that be translated to a label and ultimately set the
size for the scratch volume in Windows. However, this actually only worked if
interfacing with the CRI api directly (crictl) as Kubernetes itself will
fail to validate annotations that if split by "/" end up with > 2 parts,
which the snapshot labels will (containerd.io / snapshot / foobarbaz).

With this in mind, passing the annotations and filtering to
containerd.io/snapshot/* is moot, so I've removed this code in favor of
a new `snapshotterOpts()` function that will return platform specific
snapshotter options if ones exist. Now on Windows we can just check if
RootfsSizeInBytes is set on the WindowsContainerResources struct and
then return a snapshotter option that sets the right label.

So all in all this change:
- Gets rid of code to pass CRI annotations as labels down to snapshotters.

- Gets rid of the functionality to create a 1GB sized scratch disk if
the client provided a size < 20GB. This code is not used currently and
has a few logical shortcomings as it won't be able to create the disk
if a container is already running and using the same base layer. WCIFS
(driver that handles the unioning of windows container layers together)
holds open handles to some files that we need to delete to create the
1GB scratch disk is the underlying problem.

- Deprecates the containerd.io/snapshot/io.microsoft.container.storage.rootfs.size-gb
label in favor of a new containerd.io/snapshot/windows/rootfs.sizebytes label.
The previous label/annotation wasn't being used by us, and from a cursory
github search wasn't being used by anyone else either. Now that there is a CRI
field to specify the size, this should just be a field that users can set
on their pod specs and don't need to concern themselves with what it eventually
gets translated to, but non-CRI clients can still use the new label/deprecated
label as usual.

- Add test to cri integration suite to validate expanding the rootfs size.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-06-06 14:57:07 -07:00
Kazuyoshi Kato
8bf5995e12
Merge pull request #7018 from lucacome/bump-grpc
Bump grpc to v1.47.0
2022-06-06 10:04:10 -07:00
Luca Comellini
8bc6ccc073
Bump k8s.io deps to v0.24.1
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-06-02 15:26:54 -07:00
Luca Comellini
5fcde823dd
Bump grpc to v1.47.0
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-06-02 15:25:37 -07:00
Fu Wei
aa0aaa4947
Merge pull request #7009 from mikebrow/update-gocni 2022-06-02 11:09:46 +08:00
Mike Brown
e3b4d750db update go-cni/for cni update fixing plugins that don't respond with version
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-06-01 17:20:18 -05:00
Kazuyoshi Kato
c149e6c2ea
Merge pull request #6996 from dcantah/hpc-validations
Add validations for Windows HostProcess CRI configs
2022-06-01 11:37:12 -07:00
Paco Xu
1cf6f20320 promote pause image to 3.7
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-05-30 15:08:28 +08:00
Daniel Canter
978ff393d2 Add validations for Windows HostProcess CRI configs
HostProcess containers require every container in the pod to be a
host process container and have the corresponding field set. The Kubelet
usually enforces this so we'd error before even getting here but we recently
found a bug in this logic so better to be safe than sorry.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-05-27 21:17:07 -07:00
Sebastiaan van Stijn
5bb47fb956
vendor: github.com/urfave/cli v1.22.9
The regression in v1.22.2 has been resolved, so we can drop the
replace rule and use the latest v1.22.x version.

full diff: https://github.com/urfave/cli/compare/v1.22.1...v1.22.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 13:05:54 +02:00
Phil Estes
133978f893
Merge pull request #6932 from lucacome/bump-otel-deps
Bump OpenTelemetry dependencies
2022-05-12 19:28:35 +01:00
Sebastiaan van Stijn
c4ce13a282
vendor: github.com/opencontainers/runc v1.1.2
no changes in vendored code

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-12 13:40:43 +02:00
Luca Comellini
c1140aef65
Bump OpenTelemetry dependencies
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-05-11 18:03:09 -07:00
Daniel Canter
d1c49781ed go.mod: Bump k8s deps to v0.24.0
This ends up bumping the prometheus client as well.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-05-06 13:37:15 -07:00
Kazuyoshi Kato
7a834516f6 Share images between TestRestartMonitor and TestRestartMonitorWithOnFailurePolicy
These tests are launching containerd and pulling busybox there, while
other tests are using busybox from TestMain().

This commit shares busybox at least between TestRestartMonitor and
TestRestartMonitorWithOnFailurePolicy to reduce the chance of
throttling from ghcr.io.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-05-04 16:50:19 +00:00
Kazuyoshi Kato
8160a3efc3 Reduce the number of the concurrent HTTP requests in TestUserNamespaces
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-29 22:51:39 +00:00
Kazuyoshi Kato
7183fc81d2 Skip TestImagePullWithConcurrencyLimit on Cirrus CI
This test tends to fail under Cirrus CI + Vagrant. Skipping for now
since running the test on GitHub Actions would be suffice.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-29 22:14:24 +00:00
Michael Zappa
5d0730370d Update go-cni to v1.1.5
Signed-off-by: Michael Zappa <Michael.Zappa@stateless.net>
2022-04-27 16:27:10 -06:00
Kazuyoshi Kato
cb84b5a1d2
Merge pull request #6865 from log1cb0mb/bump-opencontainers/selinux-to-v1.10.1
Bump opencontainers/selinux from 1.10.0 to 1.10.1
2022-04-27 14:46:21 -07:00
log1cb0mb
ae29594d0b Bump opencontainers/selinux from 1.10.0 to 1.10.1
Signed-off-by: Nabeel Rana <nabeelnrana@gmail.com>
2022-04-27 22:55:25 +03:00
Kazuyoshi Kato
7f23296b99 Upgrade google.golang.org/grpc and google.golang.org/protobuf
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-27 17:25:02 +00:00
Kazuyoshi Kato
7353006f69 Remove kzys/typeurl
I forgot to remove my fork from integration/client/go.mod.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-27 17:16:51 +00:00
Derek McGowan
6e0231f992
Merge pull request #6150 from fuweid/support-4984
feature: support image pull progress timeout
2022-04-26 12:15:09 -07:00
Wei Fu
00d102da9f feature: support image pull progress timeout
Kubelet sends the PullImage request without timeout, because the image size
is unknown and timeout is hard to defined. The pulling request might run
into 0B/s speed, if containerd can't receive any packet in that connection.
For this case, the containerd should cancel the PullImage request.

Although containerd provides ingester manager to track the progress of pulling
request, for example `ctr image pull` shows the console progress bar, it needs
more CPU resources to open/read the ingested files to get status.

In order to support progress timeout feature with lower overhead, this
patch uses http.RoundTripper wrapper to track active progress. That
wrapper will increase active-request number and return the
countingReadCloser wrapper for http.Response.Body. Each bytes-read
can be count and the active-request number will be descreased when the
countingReadCloser wrapper has been closed. For the progress tracker,
it can check the active-request number and bytes-read at intervals. If
there is no any progress, the progress tracker should cancel the
request.

NOTE: For each blob data, the containerd will make sure that the content
writer is opened before sending http request to the registry. Therefore, the
progress reporter can rely on the active-request number.

fixed: #4984

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-04-27 00:02:27 +08:00
Derek McGowan
3dbd6a2498
Merge pull request #6841 from kzys/proto-upgrade-6
Migrate off from github.com/gogo/protobuf
2022-04-25 15:12:51 -07:00
Kazuyoshi Kato
2ca54ee8ae
Merge pull request #6180 from claudiubelu/integration/windows-ip-leak
integration: Adds Windows equivalent for TestSandboxRemoveWithoutIPLeakage
2022-04-25 11:27:31 -07:00
Kazuyoshi Kato
aefd1849b6 go mod tidy and go mod vendor
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:41:05 +00:00
Kazuyoshi Kato
f616dd471e Upgrade containerd/typeurl
https://github.com/containerd/typeurl/pull/35 is needed to handle
types generated by protoc-gen-go.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:40:56 +00:00
Kazuyoshi Kato
1a095e18ba Rename Size_ to Size
Previouslty "Size" was reserved by protoc-gen-gogoctrd and user-generated
"Size" was automatically renamed to "Size_" to avoid conflicts.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:31:53 +00:00
Kazuyoshi Kato
e044759ebd Upgrade containerd/ttrpc
protoc-gen-go-ttrpc's generated Go code doesn't work with ttrpc v1.1.0.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:31:52 +00:00
Kazuyoshi Kato
dfa6e8763e diff: hide types.Any from clients
This commit hides types.Any from the diff package's interface. Clients
(incl. imgcrypt) shouldn't aware about gogo/protobuf.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-21 13:43:20 +00:00
Derek McGowan
902212651b
Merge pull request #6826 from kzys/ptypes
Consolidate gogo/protobuf dependencies under our own protobuf package
2022-04-19 10:13:56 -07:00
Fu Wei
9503d7219e
Merge pull request #6744 from Junnplus/restart-policy
Add restart policy for enhanced restart manager
2022-04-20 00:12:31 +08:00
Kazuyoshi Kato
88c0c7201e Consolidate gogo/protobuf dependencies under our own protobuf package
This would make gogo/protobuf migration easier.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 15:53:36 +00:00
Kazuyoshi Kato
80b825ca2c Remove gogoproto.stdtime
This commit removes gogoproto.stdtime, since it is not supported by
Google's official toolchain
(see https://github.com/containerd/containerd/issues/6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 13:39:30 +00:00
Ye Sijun
3df7674058 add restart policy for enhanced restart manager
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-04-09 01:04:11 +08:00
Ed Bartosh
825c1c58a9 CDI: update go.mod and vendor deps
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2022-04-06 13:10:59 +03:00
Gabriel Adrian Samfira
50921e71bb
Run go mod tidy in integration tests
make integration currently fails due to outdated go.mod.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-04-04 11:01:56 +03:00
Akihiro Suda
9f4e13973d
Merge pull request #6765 from thaJeztah/move_indirects
go.mod: move indirects, and update integration go.mod to 1.18
2022-04-03 07:09:20 +09:00
Sebastiaan van Stijn
99c194e033
go.mod: move indirects, and update integration go.mod to 1.18
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-02 12:02:13 +02:00
Maksym Pavlenko
871b6b6a9f Use testify
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-01 18:17:58 -07:00
Akihiro Suda
11a31320bb
go.mod: github.com/opencontainers/runc v1.1.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-04-01 15:16:08 +09:00
Phil Estes
3633cae64b
Merge pull request #6706 from kzys/typeurl-upgrade
Use typeurl.Any instead of github.com/gogo/protobuf/types.Any
2022-03-25 10:38:46 -04:00
Kazuyoshi Kato
96b16b447d Use typeurl.Any instead of github.com/gogo/protobuf/types.Any
This commit upgrades github.com/containerd/typeurl to use typeurl.Any.
The interface hides gogo/protobuf/types.Any from containerd's Go client.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-03-24 20:50:07 +00:00
Mike Brown
a51da91c1d moving up to go-cni v1.1.4
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-03-23 22:16:51 +00:00
Sebastiaan van Stijn
36612d692f
go.mod: remove replace and update github.com/gogo/googleapis v1.4.1
gogo/googleapis has a single dependency (github.com/gogo/protobuf), which is
currently the same version as we use, and we have a separate replace for that
dependency, so removing this override should not make a difference there.

gogo/googleapis v1.4.1 Includes updated protos with the gogo/protobuf fixes for
[CVE-2021-3121](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3121)

Change logs and diffs for each release:

- v1.3.3
  generate grpc service for google/longrunning/operations.proto
  full diff: https://github.com/gogo/googleapis/compare/v1.3.2...v1.3.3
- v1.4.0
  Add google geo type
  full diff: https://github.com/gogo/googleapis/compare/v1.3.3...v1.4.0
- v1.4.1
  This release contains sources generated with the version of gogo/protobuf
  containing a fix for the "skippy peanut butter" issue.
  full diff: https://github.com/gogo/googleapis/compare/v1.4.0...v1.4.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-23 16:56:30 +01:00
Kazuyoshi Kato
388ee880d2 Upgrade containerd/imgcrypt and opencontainers/image-spec
- Upgrade github.com/containerd/imgcrypt to prepare for typeurl upgrade
  (see https://github.com/containerd/imgcrypt/pull/72)
- Upgrade github.com/opencontainers/image-spec since imgcrypto needs at
  least 1.0.2.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-03-22 21:17:18 +00:00
Michael Crosby
0c701654a1
Merge pull request #6690 from estesp/update-prom-dep
Update prometheus client vendor
2022-03-18 12:40:57 -04:00
Phil Estes
c568752335
Update prometheus client vendor
Signed-off-by: Phil Estes <estesp@amazon.com>
2022-03-17 13:33:07 -04:00
Sebastiaan van Stijn
9aadef1bee
vendor: golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
full diff: 32db794688...3147a52a75

This version contains a fix for CVE-2022-27191 (not sure if it affects us).

From the golang mailing list:

    Hello gophers,

    Version v0.0.0-20220315160706-3147a52a75dd of golang.org/x/crypto/ssh implements
    client authentication support for signature algorithms based on SHA-2 for use with
    existing RSA keys.

    Previously, a client would fail to authenticate with RSA keys to servers that
    reject signature algorithms based on SHA-1. This includes OpenSSH 8.8 by default
    and—starting today March 15, 2022 for recently uploaded keys.

    We are providing this announcement as the error (“ssh: unable to authenticate”)
    might otherwise be difficult to troubleshoot.

    Version v0.0.0-20220314234659-1baeb1ce4c0b (included in the version above) also
    fixes a potential security issue where an attacker could cause a crash in a
    golang.org/x/crypto/ssh server under these conditions:

    - The server has been configured by passing a Signer to ServerConfig.AddHostKey.
    - The Signer passed to AddHostKey does not also implement AlgorithmSigner.
    - The Signer passed to AddHostKey does return a key of type “ssh-rsa” from its PublicKey method.

    Servers that only use Signer implementations provided by the ssh package are
    unaffected. This is CVE-2022-27191.

    Alla prossima,

    Filippo for the Go Security team

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-17 14:13:41 +01:00
Fu Wei
79d7df70d6
Merge pull request #6681 from Juneezee/test/t.TempDir 2022-03-16 14:54:16 +08:00
Eng Zer Jun
18ec2761c0
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>
2022-03-15 14:03:50 +08:00
Henry Wang
2e080bf491 Add shared content label to namespaces
Signed-off-by: Henry Wang <henwang@amazon.com>
2022-03-11 23:37:02 -08:00
Paul "TBBle" Hampson
6a25be94e9 CRI integration test for Windows Device mounts
This test takes advantage of the fact that when you tell Windows to
mount the GUID_DEVINTERFACE_DISPLAY_ADAPTER class, it will also mount
the host's device store into the container, even if there is no real GPU
on the host.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2022-03-12 08:16:43 +11:00
Phil Estes
8047eb2fca
Merge pull request #6635 from gabriel-samfira/fix-deadline-exceeded-in-daemon-restart
[Windows] Fix deadline exceeded in daemon restart
2022-03-10 12:30:38 -05:00
Gabriel Adrian Samfira
80bc32f069
Use temp file for export/import test
Using a bytes buffer for this test increases the memory usage on Windows
to over 3 GB. Using a temporary file as a destination for the image
keeps memory usage at a reasonable level.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-03-10 11:48:38 +02:00
Phil Estes
b521429b67
Merge pull request #6495 from thaJeztah/improve_versions
strip path-info from `-v` (version) output, and implement -v flag for containerd-shim
2022-03-08 13:57:34 -05:00
Gabriel Adrian Samfira
14901335c1
Increase wait timeout for TestDaemonRestart
Windows needs a bit more time to finish the restarting containerd. With
the current 2 second timeout, we run the risk of exceeding that
deadline.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-03-08 18:09:42 +02:00
Paul "TBBle" Hampson
5b78a9a8f1 Remove hardcoded /tmp in tempfile paths
There's no specific need mentioned at the points it was added, and it
makes the Windows-hosted test run setup slightly weird.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2022-03-06 17:32:25 +11:00
Phil Estes
5427aec4f1
Merge pull request #6595 from zhsj/fix-cri-test
cri: fix integration test on cgroupsv2 system
2022-03-04 13:20:45 -05:00
Phil Estes
ab2f7dcdbc
Merge pull request #6568 from katiewasnothere/cri_integration_tests_windows
Update TestContainerSymlinkVolumes to use windows path
2022-03-03 10:19:56 -05:00
Shengjing Zhu
775facd573 cri: fix integration test on cgroupsv2 system
TestUpdateContainerResources_MemoryLimit still uses old method to
check memlimit in cgroup.

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-02-28 21:27:53 +08:00
Shengjing Zhu
f1f69d4eeb integration: remove duplicated util pkg
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-02-28 20:36:01 +08:00
Shengjing Zhu
ea3d2e6433 go.mod: update to github.com/tchap/go-patricia/v2 v2.3.1
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-02-26 05:04:55 +08:00
Phil Estes
2b2372d43e
Merge pull request #6337 from thaJeztah/bump_go_restful
go.mod: update to github.com/emicklei/go-restful/v3 v3.7.3
2022-02-22 17:33:37 -05:00
Shengjing Zhu
f4f41296c2 Replace golang.org/x/net/context with std library
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-02-22 02:27:05 +08:00
Kathryn Baldauf
a3303e7214 Update TestContainerSymlinkVolumes to use windows path
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2022-02-18 16:21:40 -08:00
Sebastiaan van Stijn
481fb923c5
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>
2022-02-18 21:54:27 +01:00
Phil Estes
39afc6fd47
Merge pull request #6515 from gabriel-samfira/enable-restart-monitor
[Windows][Integration] Enable TestRestartMonitor
2022-02-16 10:37:29 -05:00
Sebastiaan van Stijn
1a31772a7a
go.mod: github.com/moby/sys/signal v0.7.0
full diff: https://github.com/moby/sys/compare/signal/v0.6.0...signal/v0.7.0

- add LCOW supported signals to windows signal map

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-15 14:17:17 +01:00
Sebastiaan van Stijn
b1881bdc04
go.mod: github.com/moby/sys/mountinfo v0.6.0
full diff: https://github.com/moby/sys/compare/mountinfo/v0.5.0...mountinfo/v0.6.0

- Add MountedFast (Note: most users should keep using Mounted, which already
  incorporates all optimizations from MountedFast)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-15 14:15:32 +01:00
Sebastiaan van Stijn
b6a6757c11
go.mod: github.com/fsnotify/fsnotify v1.5.1
full diff: https://github.com/fsnotify/fsnotify/compare/v1.4.9...v1.5.1

Relevant changes:

- Fix unsafe pointer conversion
- Drop support/testing for Go 1.11 and earlier
- Update x/sys to latest
- add //go:build lines
- add go 1.17 to test matrix

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-02-15 14:11:18 +01:00
Maksym Pavlenko
7efd485b6e
Merge pull request #6543 from dmcgowan/update-cni-v1.1.2
Update go-cni to v1.1.3
2022-02-14 17:03:54 -08:00
Derek McGowan
fa19714db9
Update go-cni to v1.1.3
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-02-14 10:37:31 -08:00
Derek McGowan
c0f8188469
Update go-cni to v1.1.2
Fixes panic when exec is nil

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-02-10 12:40:51 -08:00
Gabriel Adrian Samfira
4f0d5f0ee3 Enable TestContainerPTY and TestContainerUsername
Enables TestContainerPTY and TestContainerUsername on Windows.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-02-10 06:46:42 +00:00
Gabriel Adrian Samfira
b63000c65d
[Windows][Integration] Enable TestRestartMonitor
With the release of hcsshim v0.9.2, this test should pass without
issues on Windows.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2022-02-04 17:27:14 +02:00
Michael Crosby
9a08d6fcde
Merge pull request #6457 from kzys/otel-http
tracing: use OTLP/HTTP in addition to OTLP/gRPC
2022-02-02 14:24:15 -05:00
Derek McGowan
8d69c041c5
Update cgroups to v1.0.3
Pull in latest cgroups to pick up leak fixes

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-02-01 16:57:51 -08:00
Sebastiaan van Stijn
e79aba10d4
integration/images/volume-ownership: strip path information from usage output
POSIX guidelines describes; https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html#g_t_002d_002dversion

> The program’s name should be a constant string; don’t compute it from argv[0].
> The idea is to state the standard or canonical name for the program, not its
> file name.

We don't have a const for this, but let's make a start and just remove the path info.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-01-31 21:07:00 +01:00
Kazuyoshi Kato
e751f1f44f tracing: support OTLP/HTTP in addition to gRPC
This change adds OTLP/HTTP, specifically http/protobuf support.

http/protobuf is recommended in
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.8.0/specification/protocol/exporter.md.

However kube-apiserver and CRI-O use gRPC, kubelet may support
gRPC in future. So we should support gRPC as well.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-01-29 00:41:18 +00:00
Wei Fu
31a710c492 fix: should not send 137 code event if cmd is notfound
ShimV2 has shim.Delete command to cleanup task's temporary resource,
like bundle folder. Since the shim server exits and no persistent store
is for task's exit code, the result of shim.Delete is always 137 exit
code, like the task has been killed.

And the result of shim.Delete can be used as task event only when the
shim server is killed somehow after container is running. Therefore,
dockerd, which watches task exit event to update status of container,
can report correct status.

Back to the issue #6429, the container is not running because the
entrypoint is not found. Based on this design, we should not send
137 exitcode event to subscriber.

This commit is aimed to remove shim instance first and then the
`cleanupAfterDeadShim` should not send event.

Similar Issue: #4769
Fix #6429

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-01-22 00:58:33 +08:00
Michael Crosby
f2c2d07683
Merge pull request #6458 from dcantah/change-to-constant-win2022
Integration: Change to Windows Server 2022 build number constant
2022-01-19 16:19:00 -05:00
Daniel Canter
7d7064e6b4 Integration: Change to Windows Server 2022 build number constant
The build number used to determine whether we need to pull the Windows
Server 2022 image for the integration tests was previously hardcoded as there
wasn't an hcsshim release with the build number. Now that there is and it's
vendored in, this change just swaps to it.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-01-19 11:54:22 -08:00
Derek McGowan
2898004a5b
Update kubernetes vendor to 0.22.5
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-01-19 11:24:12 -08:00
Derek McGowan
5089b12100
Merge pull request #6439 from dmcgowan/remove-submodule-go-mod
Remove submodule go mod
2022-01-19 11:20:04 -08:00
Phil Estes
778da8bae9
Merge pull request #6453 from dcantah/bump-hcsshim-0.9.2
go.mod: Update hcsshim to v0.9.2
2022-01-19 08:34:46 -05:00
Akihiro Suda
f0afdea2ad
Merge pull request #6375 from AkihiroSuda/runc-1.1.0
update runc to v1.1.0
2022-01-19 15:19:59 +09:00
Daniel Canter
af39d2ad71 go.mod: Update hcsshim to v0.9.2
This tag brings in some bug fixes related to waiting for containers to terminate and
trying to kill an already terminated process, as well as tty support (exec -it) for
Windows Host Process Containers.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-01-18 17:34:52 -08:00
Derek McGowan
fcb7bd6997
Remove api go submodule
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-01-18 14:48:33 -08:00
Akihiro Suda
21a748e381
go.mod: github.com/opencontainers/runc v1.1.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-01-18 13:35:22 +09:00
Brian Goff
d5e8edf2df Do not automatically inject client traces
This is a effective revert of 294143bf38
The one thing that makes it not a total revert is this keeps the usage
of chain interceptors, which prevents us from overwriting interceptors
passed into client options.

The automatic trace injection is unnecessary overhead since callers of
this function can add the necessary interceptors when creating the
client.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-01-13 22:11:18 +00:00
Phil Estes
c3177caf0c
Merge pull request #6435 from alunsin/dev/build-image-for-ppc64le
Add ppc64 support for test images
2022-01-12 14:44:49 -05:00
Aurelien Lun-Sin
c0a31a7a40
Add ppc64 support for test images
Signed-off-by: Aurelien Lun-Sin <alunsin@us.ibm.com>
2022-01-11 19:58:31 +01:00
宁明晓10296073
b35fb7d447 remove io/ioutil
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2022-01-11 16:07:23 +08:00
Derek McGowan
468513820d
Merge pull request #6351 from adisky/update-k/k-1.23
Updates CRI API & Kubernetes to 1.23
2022-01-07 15:26:44 -08:00
Derek McGowan
647308bc47
Merge pull request #6410 from AkihiroSuda/update-go-mod-20220107
go.mod: update github.com/containerd/{continuity,go-cni,imgcrypt}
2022-01-07 12:34:44 -08:00
Akihiro Suda
d3724a6c17
go.mod: update github.com/containerd/{continuity,go-cni,imgcrypt}
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-01-07 18:54:15 +09:00
haoyun
bbe46b8c43 feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08:00
Aditi Sharma
e43d4206af Update k/k to 1.23.0
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2022-01-06 11:18:23 +05:30
Markus Lehtonen
eba1048163 Update dependencies
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Claudiu Belu
894af07e37 integration: Adds Windows equivalent for TestSandboxRemoveWithoutIPLeakage
Adds an equivalent TestSandboxRemoveWithoutIPLeakage for Windows, in which
we assert that the IPs are not leaked when a Pod's HNS namespace dissapears
and the Pod is deleted afterwards.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2022-01-03 00:26:47 -08:00
Fu Wei
3ab676ce22
Merge pull request #6395 from jonyhy96/fix-abstract 2021-12-28 18:13:34 +08:00
haoyun
85326d76f4 fix: only test abstract unix socket on linux
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-28 17:07:19 +08:00
Akihiro Suda
1a078e6893
Merge pull request #6390 from gabriel-samfira/fix-restart-container-test
Fix restart container test
2021-12-24 18:29:57 +09:00
Gabriel Adrian Samfira
653b8b02ad
Expect ErrorNotFound on Windows after Kill()
The "notready-sandbox" array will only have a CONTAINER_CREATED
and a CONTAINER_EXITED in the sandbox. So there will be no running
task to send a Kill() to. This means that on Windows, it will always
return an ErrorNotFound.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-21 11:17:49 +02:00
Michael Crosby
3ae95e78a1
Merge pull request #6384 from dcantah/fix-nodaemon
Fix no-daemon flag for integration/client tests
2021-12-20 13:26:57 -05:00
Gabriel Adrian Samfira
0ff87a8929
Replace tskill with taskkill
This offers a more reliable way of killing a process. The /IM flag
allows us to specify the "image name" of the process we're killing.
This means we can use wildcards, foce kill a process and all the child
processes it may have spawned.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-20 18:33:36 +02:00
Gabriel Adrian Samfira
aadae6d50b
Fix flakiness on Windows for list stats
This change fixes flakiness on Windows for TestContainerListStatsWithSandboxIdFilter

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-17 17:38:37 +02:00
Daniel Canter
d53c431334 Fix no-daemon flag for integration/client tests
The global &daemon{} object only gets an address assigned if you call
start() on it, which only gets called if you don't pass no-daemon. The
aftermath of this is that running the integration tests with no-daemon
just has them fail trying to create a client for containerd.
This change just assigns whatever address is passed to the binary even in
the no-daemon case so you can run the integration tests against an already
running containerd instance.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-17 08:58:39 -05:00
Kazuyoshi Kato
5c2edeffbc Upgrade k8s.io/klog/v2 from 2.9.0 to 2.20.0
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 23:10:06 +00:00
Kazuyoshi Kato
2ee3ce510c Use insecure.NewCredentials instead of grpc.WithInsecure
grpc.WithInsecure is being deprecated.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 23:10:06 +00:00
Kazuyoshi Kato
2fb739aa21 Upgrade OpenTelemetry dependencies
This commit upgrades the packages under go.opentelemetry.io/.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 22:35:57 +00:00
Daniel Canter
abcf7c2f6a Disable TestContainerHook on Windows
OCI hooks aren't implemented on Windows. The test will, and has been,
actuallyrunning fine on Windows because the Github runners seem to have
a 'ps' binary in the users PATH, but there's not any actual hook
functionality being tested as any of the OCI fields are ignored for
Windows containers.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-14 17:35:02 -08:00
Phil Estes
949db57213
Merge pull request #6320 from endocrimes/dani/cri-swap
cri: add support for configuring swap
2021-12-14 15:02:28 -05:00
Derek McGowan
0def0dbecb
Merge pull request #6275 from gabriel-samfira/enable-volume-ownership-test
Integration: Enable TestVolumeOwnership on Windows
2021-12-14 09:33:24 -08:00
Wei Fu
9e9ee66bfd integration: deflake TestContainerdRestart
The CRI-plugin will setup watcher for each container after
StartContainer or RunPodSandbox. It will cleanup task(container/sandbox)
if received the exit event from watcher.

The original test design is to `Delete` sandbox container to get
NOT_READY state and expect to receive NotFound error. It depends on that
CRI-plugin cleanups container after `Delete` API. If not, the shim will
be cleanup and test code will receive `ttrpc: closed: unknown` or other
unknown error. It is flaky.

In this patch, the test will only send the kill signal and wait for the
exit event. When sandbox exits, the state will and must be NOT_READY.

```plain
// test fail log

=== RUN TestContainerdRestart
restart_test.go:92: Make sure no sandbox is running before test
restart_test.go:97: Start test sandboxes and containers
common.go:115: Image "k8s.gcr.io/pause:3.6" already exists, not pulling.
common.go:115: Image "k8s.gcr.io/pause:3.6" already exists, not pulling.
restart_test.go:139:
Error Trace: restart_test.go:139
Error: Should be true
Test: TestContainerdRestart
Messages: delete should return not found error but returned failed to delete task: ttrpc: closed: unknown
--- FAIL: TestContainerdRestart (4.25s)

// containerd log

&TaskExit{ContainerID:4b4c1d1d303c14a2cc759631d163f153ba8536e9ea6821744a509e4a17346184,ID:4b4c1d1d303c14a2cc759631d163f153ba8536e9ea6821744a509e4a17346184,Pid:28430,ExitStatus:137,ExitedAt:2021-12-12 07:56:01.400753012 +0000 UTC,XXX_unrecognized:[],}"
time="2021-12-12T07:56:01.401120516Z" level=debug msg="event forwarded" ns=k8s.io topic=/tasks/exit type=containerd.events.TaskExit
time="2021-12-12T07:56:01.418934208Z" level=debug msg="event forwarded" ns=k8s.io topic=/tasks/delete type=containerd.events.TaskDelete
time="2021-12-12T07:56:01.419192910Z" level=info msg="shim disconnected" id=4b4c1d1d303c14a2cc759631d163f153ba8536e9ea6821744a509e4a17346184
time="2021-12-12T07:56:01.419235911Z" level=warning msg="cleaning up after shim disconnected" id=4b4c1d1d303c14a2cc759631d163f153ba8536e9ea6821744a509e4a17346184 namespace=k8s.io
time="2021-12-12T07:56:01.419247711Z" level=info msg="cleaning up dead shim"
time="2021-12-12T07:56:01.419235311Z" level=error msg="failed sending message on channel" error="write unix /run/containerd/s/18afde7fcde70236eb31b9f43f3bd92af1dc1186583c501aa1396255f87f95d4->@: write: broken pipe"
time="2021-12-12T07:56:01.419354712Z" level=debug msg="failed to delete task" error="ttrpc: closed" id=4b4c1d1d303c14a2cc759631d163f153ba8536e9ea6821744a509e4a17346184
```

CI Link: `https://pipelines.actions.githubusercontent.com/G4SighzWVVZ6vsyiz7FFMFjLjRzveJHseEnVyibkSq87Cl2x4O/_apis/pipelines/1/runs/9501/signedlogcontent/76?urlExpires=2021-12-12T08%3A42%3A08.0765750Z&urlSigningMethod=HMACV1&urlSignature=pH93isMSFdZUo1ndnZynJpZbPGrEyvt12MO03fgUU7I%3D`

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-12-13 23:43:26 +08:00
Derek McGowan
552a27081c
Disable restart monitor test in Windows
Skip this test until this error can be evaluated and the appropriate
test fix or environment configuration can be determined.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-12-10 11:43:23 -08:00
Maksym Pavlenko
95b83fa54f
Merge pull request #6355 from dmcgowan/integration-client-restart-daemon-output
Update restart monitor test to output daemon logs on failure
2021-12-09 13:51:01 -08:00
Derek McGowan
2c96d5b067
Run windows parallel integration test as short
This prevents tests which spawn daemons from running at
the same time as the first integration test.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-12-09 11:45:38 -08:00
Derek McGowan
807213fd32
Update restart monitor test to output daemon logs on failure
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-12-09 11:45:37 -08:00
Sebastiaan van Stijn
fc8138468f
go.mod: update image-spec to latest (v1.0.3-dev)
The OCI image spec did a v1.0.2 security release for CVE-2021-41190, however
commit 09c9270fee, depends on MediaTypes that
have not yet been released by the OCI image-spec, so using current "main" instead.

full diff: 5ad6f50d62...693428a734

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-09 17:50:09 +01:00
Gabriel Adrian Samfira
77a321a073 Replace find with native Go code
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-07 11:04:38 +00:00
Gabriel Adrian Samfira
22dc60e059 Enable TestVolumeOwnership on Windows
This change enables the TestVolumeOwnership on Windows. The test
assumes that the volume-ownership image is built on Windows, thus
ensuring that Windows file security info (ACLs and ownership info)
are attached to the C:\volumes\test_dir path.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-07 10:47:13 +00:00
Akihiro Suda
c9d1e155c7
go.mod: github.com/opencontainers/runc v1.0.3
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-06 15:12:22 +09:00
Maksym Pavlenko
d06bce4d3d
Merge pull request #6314 from dcantah/ws2022-ci
Add Windows Server 2022 CI runs
2021-12-03 10:51:00 -08:00
Phil Estes
d742453086
Merge pull request #6324 from gabriel-samfira/set-explicit-acl
Set explicit ACL on test files
2021-12-03 13:14:04 -05:00
Gabriel Adrian Samfira
392f604eba
Use a single RUN command
Run test file creation in single RUN command.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-03 18:10:39 +02:00
Danielle Lancashire
533dd1c0ee fixup: check for swap accounting
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
2021-12-03 16:04:01 +01:00
Sebastiaan van Stijn
f33d38c7cb
integration: align tags of test images
I noticed we were using some different versions of the same test
images, so changing them to be the same (can help with find/replace
if we need to update them).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-03 15:14:09 +01:00
Danielle Lancashire
c5b0a18b6e fixup: handle diff between cgroupsv1 and v2
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
2021-12-03 14:35:00 +01:00
Gabriel Adrian Samfira
9cc0d1f073
Set explicit ACL on test files
It seems that the default ACLs inherited from the parent folder
on Windows Server 2022, does not include "CREATOR OWNER" as it
does on Windows Server 2019. This sets explicit ACLs on test
files.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-03 14:16:28 +02:00
Daniel Canter
ff77dd1121 Add Windows Server 2022 CI runs
GA for ws2022 github actions VMs launched a couple weeks ago so seems like
it's time to try out the CI on this new SKU.

This involved adding new ws2022 runs for the OS matrices in the CI, fixing up
a test in the platforms package and adding a mapping for the ws2022 container image in
integration/client.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-02 16:18:25 -08:00
Gabriel Adrian Samfira
fd0850e9ef
Update continuity dependency
This change ensures that Windows security info is
copied.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-03 00:26:45 +02:00
Gabriel Adrian Samfira
ff9d7aef32
Update volume test images
Update volume test images to version 2.1. This enables Windows
volume tests.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-03 00:02:45 +02:00
Phil Estes
08812f3fb7
Merge pull request #6201 from dmcgowan/test-restart-monitor-check-timestamp
Update TestRestartMonitor expected time check
2021-12-02 15:30:27 -05:00
Danielle Lancashire
2fa4e9c0e2 cri: add support for configuring swap
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
2021-12-02 21:25:33 +01:00
Phil Estes
8063fdab08
Merge pull request #6319 from dmcgowan/update-windows-integration-image-to-ghcr
Move test volume images from gcr to ghcr
2021-12-02 15:02:22 -05:00
Derek McGowan
bae0d88ae7
Add error logging on cleanup
Check the errors for task and container deletion during restart test
cleanup.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-12-02 11:47:14 -08:00
Maksym Pavlenko
6bccd67e84 Revert shim plugin migration
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-02 10:35:15 -08:00
Derek McGowan
665877a5bf
Move volume images from gcr to ghcr
With the ghcr images now built and working, switch over to
use these new images and update the default name.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-12-02 10:29:44 -08:00
Daniel Canter
2a6857d060 Skip TestExportAndImportMultiLayer on Windows
This change skips the TestExportAndImportMultiLayer in integration/client
for the time being. It seems the image was updated recently and no longer
has a Windows entry in the manifest so the test will always fail. This should
be reverted when we figure out what happened to the image, but this is to
unblock PRs for the time being.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-01 16:58:52 -08:00
Phil Estes
3d1c85d954
Merge pull request #6274 from gabriel-samfira/build-image-on-windows
Build volume test images on Windows
2021-11-30 09:49:08 -05:00
Wei Fu
8de1117c99 integration: add stats result in error message
```
// from  https://github.com/containerd/containerd/pull/6150#issuecomment-974747473

container_stats_test.go:364:
        	Error Trace:	container_stats_test.go:364
        	Error:      	Received unexpected error:
        	            	unexpected stats length
        	            	github.com/containerd/containerd/integration.TestContainerListStatsWithIdSandboxIdFilter.func4
        	            		/home/runner/work/containerd/containerd/integration/container_stats_test.go:371
        	            	github.com/containerd/containerd/integration.Eventually
        	            		/home/runner/work/containerd/containerd/integration/main_test.go:324
        	            	github.com/containerd/containerd/integration.TestContainerListStatsWithIdSandboxIdFilter
        	            		/home/runner/work/containerd/containerd/integration/container_stats_test.go:364
        	            	testing.tRunner
        	            		/opt/hostedtoolcache/go/1.17.3/x64/src/testing/testing.go:1259
        	            	runtime.goexit
        	            		/opt/hostedtoolcache/go/1.17.3/x64/src/runtime/asm_amd64.s:1581
        	Test:       	TestContainerListStatsWithIdSandboxIdFilter
```

Add stats result for the purpose of debug.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-11-28 16:57:40 +08:00
Gabriel Adrian Samfira
1698d061c3 Build volume test images on Windows
* Adds Windows dockerfile for volume-ownership image
  * Build volume-copy-up on Windows
  * Adds a helper tool that fetches the owner username and SID of
a file or folder
  * Adds README
  * Remove 2004 from Windows versions
  * Add ltsc2022 to Windows versions

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-11-25 09:54:35 +00:00
Takumasa Sakao
2b28dd363b Fix wrong make target on documentation
Signed-off-by: Takumasa Sakao <sakataku7@gmail.com>
2021-11-23 03:42:08 +09:00
Derek McGowan
f5863e22f4
Update API version in go.mod
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-11-18 16:21:19 -08:00
Daniel Canter
b103bee4cc go.mod: Bump hcsshim to v0.9.1
This tag contains some changes for the Windows shim for retrying
stdio named pipe connections if containerd restarts. It also is built with v1.1.0 of
ttrpc which has some fixes for a deadlock we'd observed on Windows.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-11-10 16:26:18 -08:00
Daniel Canter
920b24793d go.mod: Bump ttrpc to 1.1.0
This tag contains a fix for a deadlock observed when there are multiple
simultaneous requests from the same client connection.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-11-10 10:20:14 -08:00
Sebastiaan van Stijn
97073c9437
go.mod: github.com/moby/sys/mountinfo v0.5.0
full diff: https://github.com/moby/sys/compare/95edfa939201...mountinfo/v0.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:10:26 +01:00
Sebastiaan van Stijn
19d9d0d2a5
go.mod: github.com/moby/sys/signal v0.6.0
full diff: https://github.com/moby/sys/compare/8a51b5cc8879...signal/v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:08:07 +01:00
Sebastiaan van Stijn
9c455ded61
go.mod: github.com/moby/sys/symlink v0.2.0
full diff: https://github.com/moby/sys/compare/symlink/v0.1.0...symlink/v0.2.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:05:38 +01:00
Sebastiaan van Stijn
fa12f4e696
go.mod: golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
full diff: ed5796bab1...69cdffdb93

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-11-05 13:03:15 +01:00
Derek McGowan
54c0cdae60
Update TestRestartMonitor expected time check
Use the time for the last non-running status to determine
whether the restart did not occur as expected. The
current timestamp only accounts for when the running
status was seen, however, the restart would have always
occurred in between the previous check and latest check.
Therefore, it makes more sense to use the previous check
to determine whether a failure was seen from the restart
monitor not restarting as expected.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-11-04 09:42:58 -07:00
Maksym Pavlenko
b5b83e0512
Merge pull request #5918 from mxpv/shim-manager
Decouple task manager
2021-11-04 16:29:52 +02:00
David Porter
b69bbe25ac Vendor latest k8s.io/cri-api and netlink
* Bump k8s.io/cri-api to latest version - v0.23.0-alpha.4
* Vendor github.com/vishvananda/netlink for network stats

Signed-off-by: David Porter <porterdavid@google.com>
2021-11-03 17:52:05 -07:00
Derek McGowan
1e36eaf11f
Merge pull request #6200 from bobbypage/restart_integration_test
test: Add grace period for restart monitor test
2021-11-03 14:53:09 -07:00
Phil Estes
fd07d74d6d
Merge pull request #6179 from claudiubelu/integration/enable-test-runtime-handler
integration: Enables TestRuntimeHandler for Windows
2021-11-03 14:14:33 -07:00
David Porter
9bfec3980b test: Add grace period for restart monitor test
restart monitor test was failing due to occasionally taking past the
deadline on windows tests. Add a small additional grace period to
deflake the test.

Signed-off-by: David Porter <porterdavid@google.com>
2021-11-03 14:07:11 -07:00
Maksym Pavlenko
6fa1bb4a5c Fix build after rebase
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 09:22:50 -07:00
Maksym Pavlenko
2cec3a34b1 Migrate task directory
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:01 -07:00
Maksym Pavlenko
a3d298193c Fix backward compatibility with old task shims
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:01 -07:00
Maksym Pavlenko
7c4ead285d Add task manager
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:36:58 -07:00
Claudiu Belu
fb4432c24a integration: Enables TestVolumeCopyUp for Windows
The image that the test is used for Windows has busybox included,
which means we can use sleep.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-07 19:30:42 -07:00
Claudiu Belu
0ba3532f54 integration: Enables TestRuntimeHandler for Windows
Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-07 18:20:59 -07:00
Derek McGowan
d97b40c300
Merge pull request #6085 from claudiubelu/integration/enables-windows-tests
integration: Enable some tests for Windows
2021-10-28 13:30:23 -07:00
Claudiu Belu
6020189003 integration: Enable some tests for Windows
Some of the tests in containerd/integration/client/ are not
currently being run on Windows, even though they can pass.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-13 16:04:46 +03:00
Claudiu Belu
830b3c26ec integration: Enable some tests for Windows (part 2)
Some of the tests that are currently running only on Linux can be made
to run on Windows with a few changes.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-07 08:13:01 -07:00
Claudiu Belu
96018b7db9 vendor: Updates go-cni
This update will allow us to forcefully delete a Windows sandbox if its
endpoint cannot be found anymore.

Fixes: #6135

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-06 05:35:53 -07:00
Derek McGowan
0d0fb68589
Merge pull request #6149 from ukontainer/vendor-moby-sys
vendor: update moby/sys for darwin support
2021-10-25 15:20:10 -07:00
Hajime Tazaki
b8f3ebb03b vendor: update moby/sys for darwin support
The mount package of darwin requires to retrive mountinfo to check if
the target of unmount if still mounted or not.  Thus pull the upstreamed
version of moby/sys to support this operation.

Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
2021-10-23 07:48:17 +09:00
Derek McGowan
45c5298700
Merge pull request #6144 from dmcgowan/prepare-v1.6.0-beta.1
Prepare v1.6.0-beta.1
2021-10-22 14:39:38 -07:00
Derek McGowan
37720fc6fd
Update api vendor
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-10-22 13:37:45 -07:00
zounengren
a217b5ac8f bump CNI to spec v1.0.0
Signed-off-by: zounengren <zouyee1989@gmail.com>
2021-10-22 10:58:40 +08:00
Brian Goff
294143bf38 Inject otel traces to grpc client.
This uses the global trace provider.
If a trace provider is not set, a no-op provider is used.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-10-21 16:08:15 +00:00
zounengren
1f1cad3912 io/ioutil package has been deprecated in Go 1.16 that replaces io/ioutil functions
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2021-10-13 09:18:31 +08:00
Derek McGowan
63b7e5771e
Merge pull request #5973 from Juneezee/deprecate-ioutil
refactor: move from io/ioutil to io and os package
2021-10-01 10:52:06 -07:00
Akihiro Suda
fbdcddedc0
Merge pull request #6076 from jonyhy96/cleanup-import
cleanup: import from k8s.io/utils/clock instead
2021-10-01 14:18:34 +09:00
haoyun
6484fab1e0 cleanup: import from k8s.io/utils/clock instead
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-09-30 23:27:20 +08:00
haoyun
d16942cf16 feat: enable cri remote client to call with grpc calloptions
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-09-30 23:02:53 +08:00
Kohei Tokunaga
09c9270fee images: enable converter to uncompress zstd
Currently uncompress converter only supports gzip. This commit fixes it to
support zstd as well.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-09-27 11:08:44 +09:00
Phil Estes
5162238c7d
Merge pull request #5853 from claudiubelu/integration/windows-hostprocess
integration: Adds Windows HostProcess tests
2021-09-26 20:35:00 -04:00
Claudiu Belu
2bc77b8a28 Adds Windows resource limits support
This will allow running Windows Containers to have their resource
limits updated through containerd. The CPU resource limits support
has been added for Windows Server 20H2 and newer, on older versions
hcsshim will raise an Unimplemented error.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-09-25 13:20:55 -07:00
Derek McGowan
c5947557d8
Add error message to in TestContainerdRestart integration test
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-10-11 08:23:31 -07:00
Derek McGowan
18d483b236
Update cgroups to v1.0.2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-10-08 17:48:33 -07:00
Derek McGowan
cb6fb93af5
Merge pull request #6011 from crosbymichael/schedcore
add runc shim support for sched core
2021-10-08 10:42:16 -07:00
Derek McGowan
60ffa3ff7d
Merge pull request #5579 from claudiubelu/integration/restart-containerd
integration: Enables Windows containerd restart test
2021-10-08 10:33:10 -07:00
Michael Crosby
f1054dbbde
fix integration client vendor
Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-10-08 16:20:21 +00:00
Daniel Canter
46b152f81b vendor: Bump hcsshim to 0.9.0
This change bumps hcsshim to 0.9.0. Main thing this tag contains is support for
Kubernetes Host Process containers
See: https://kubernetes.io/docs/tasks/configure-pod-container/create-hostprocess-pod/

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-10-07 21:00:35 -07:00
Phil Estes
e648fa2e81
Merge pull request #5933 from claudiubelu/integration/import-multilayer
integration: Adds test for multilayer image import
2021-10-07 14:09:25 -04:00
Derek McGowan
2d48b6a864
Merge pull request #6031 from fuweid/carry-5648
runtime: should fail fast if dial error on shim
2021-10-07 09:43:10 -07:00
zounengren
3a713811be run gofmt with Go 1.17
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2021-10-07 20:16:59 +08:00
Brian Goff
1ee2bff0e0 Update go otel 1.0.1
This fixes the issue with the usage of the deprecated attribute.Any
function that original caused build issues.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-10-06 00:42:56 +00:00
Kohei Tokunaga
2244540628 Fix main branch build is broken
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-09-25 11:48:14 +09:00
Claudiu Belu
7a7a9a282c integration: Adds test for multilayer image import
This test will make sure there aren't any issues with multilayered
images during import. Keep in mind that in the case of multilayered
images, they have to be unpacked first in order to be usable.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-09-22 10:03:16 -07:00
Wei Fu
f7658e37d9 runtime: should fail fast if dial error on shim
In linux platform, the shim server always listens on the socket before
the containerd task manager dial it. It is unlikely that containerd task
manager should handle reconnect because the shim can't restart. For this
case, the containerd task manager should fail fast if there is ENOENT or
ECONNREFUSED error.

And if the socket file is deleted during cleanup the exited task, it
maybe cause that containerd task manager takes long time to reload the
dead shim. For that task.v2 manager, the race case is like:

```
TaskService.Delete
  TaskManager.Delete(runtime/v2/manager.go)
    shim.delete(runtime/v2/shim.go)
      shimv2api.Shutdown(runtime/v2/task/shim.pb.go)

      <- containerd has been killed or restarted somehow

      bundle.Delete
```

The shimv2api.Shutdown will cause that the shim deletes socket file
(containerd-shim-runc-v2 does). But the bundle is still there. During
reloading, the containerd will wait for the socket file appears again
in 100 seconds. It is not reasonable. The Reconnect should prevent this
case by fast fail.

Closes: #5648.
Fixes: #5597.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-09-23 00:00:28 +08:00
Eng Zer Jun
50da673592
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-21 09:50:38 +08:00
Derek McGowan
3e72e335fe
Use github images for integration tests
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-09-20 13:35:13 -07:00
wllenyj
6d961f9673 CI: Switch to available latest images
`mirror.gcr.io/library/busybox:1.32` is unavailable.

```console
$ curl -s https://mirror.gcr.io//v2/library/busybox/tags/list | jq '.tags'
[
      "1.26.2",
      "1.27.2",
      "1.28",
      "1.29",
      "1.29.2",
      "1.29.3",
      "1.30",
      "1.30.1",
      "1.31",
      "1.31.0",
      "1.31.1",
      "1.32.0"
]
```

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2021-09-14 11:59:19 +08:00
Claudiu Belu
e087b47e98 import: Raise error if the imported image is filtered out
During import, if an image does not match the host's platform,
it won't have any children labels set, which will result in the
Garbage Collector deleting its content later, resulting in an
unusable image. In this case, we should fail early.

This can still be bypassed by using ctr import --all-platforms.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-09-13 11:19:48 -07:00
Phil Estes
a4fa3a7162
Merge pull request #6017 from thaJeztah/fix_main_nomodules
update open go.opentelemetry.io v1.0.0 to fix import path
2021-09-23 15:07:41 -04:00