Commit Graph

42 Commits

Author SHA1 Message Date
Sascha Grunert
de37b9d293
Make CRI v1 the default and allow a fallback to v1alpha2
This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-11-17 11:05:05 -08:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Iceber Gu
aff9df2cf6
dockershim: fix started and finished timestamp of the container status
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-01 22:33:56 +08:00
Kubernetes Prow Robot
db10d8c942
Merge pull request #93773 from knight42/fix/kubelet-concurrent-map-writes
fix(kubelet): protect `containerCleanupInfos` from concurrent map writes
2020-09-01 18:43:27 -07:00
knight42
ebf60155bf
test(kubelet): add a regression test to verify kubelet would not panic 2020-08-07 17:50:22 +08:00
zvier
d43817b5ec fix golint errors for pkg/kubelet/dockershim
Signed-off-by: zvier <zvier20@gmail.com>
2020-05-24 23:45:17 +08:00
mattjmcnaughton
b36f637f0d
Add dockerless tags to all files in dockershim
As the final step, add the `dockerless` tags to all files in the
dockershim. Using `-tags=dockerless` in `go build`, we can compile
kubelet without the dockershim.

Once cadvisor no longer depends on `docker/docker`, compiling with
`-tags=dockerless` should be sufficient to compile the Kubelet w/o a
dependency on `docker/docker`.
2020-05-07 17:18:50 -04:00
Aaron Brown
d1066ead3f
quote container name in container already use error matching
https://github.com/moby/moby/pull/27510 switched the container already
in use message from a bare string to a quoted string, so the
auto-deletion of "in use" containers no longer works in Docker > 17.04.
2019-07-01 17:37:35 -04:00
Davanum Srinivas
33081c1f07
New staging repository for cri-api
Change-Id: I2160b0b0ec4b9870a2d4452b428e395bbe12afbb
2019-03-26 18:21:04 -04:00
hzxuzhonghu
70e45eccf2 Replace "golang.org/x/net/context" with "context" 2018-03-22 20:57:14 +08:00
Lee Verberne
e10042d22f Increment CRI version from v1alpha1 to v1alpha2
This also incorporates the version string into the package name so
that incompatibile versions will fail to connect.

Arbitrary choices:
- The proto3 package name is runtime.v1alpha2. The proto compiler
  normally translates this to a go package of "runtime_v1alpha2", but
  I renamed it to "v1alpha2" for consistency with existing packages.
- kubelet/apis/cri is used as "internalapi". I left it alone and put the
  public "runtimeapi" in kubelet/apis/cri/runtime.
2018-02-07 09:06:26 +01:00
Yu-Ju Hong
20910289b8 Fix all the unit tests and update the bazel files 2018-01-19 16:31:18 -08:00
Kubernetes Submit Queue
84f773850e Merge pull request #49107 from edevil/try_remove_old_log
Automatic merge from submit-queue (batch tested with PRs 49107, 47177, 49234, 49224, 49227)

Make sure the previous symlink file is deleted before trying to create a new one

**What this PR does / why we need it**:

It deletes possibly existing symlinks to container log files.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

fixes #49105

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-07-20 15:08:17 -07:00
André Cruz
89012ccb23 Fix test 2017-07-19 17:14:35 +01:00
Yang Guo
bf2ced837c Updates Docker Engine API 2017-07-13 12:55:07 -07:00
Pengfei Ni
22e99504d7 Update CRI references 2017-06-09 10:16:40 +08:00
Michael Taufen
cbad320205 Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
Yu-Ju Hong
38d8da1215 FakeDockerClient: add creation timestamp
This is necessary for kubemark to work correctly.
2017-03-08 17:11:16 -08:00
Yu-Ju Hong
516848c37d Various fixes for the fake docker client
* Properly return ImageNotFoundError
 * Support inject "Images" or "ImageInspects" and keep both in sync.
 * Remove the FakeDockerPuller and let FakeDockerClient subsumes its
   functinality. This reduces the overhead to maintain both objects.
 * Various small fixes and refactoring of the testing utils.
2017-03-07 10:11:49 -08:00
Yu-Ju Hong
1759b87ffe Generate valid container id in fake docker client. 2017-03-01 10:33:08 -08:00
Jordan Liggitt
66dec96735 Revert "Generate valid container id in fake docker client." 2017-02-18 10:06:24 -05:00
Random-Liu
de922962de Generate valid container id in fake docker client. 2017-02-16 17:10:33 -08:00
Random-Liu
90e91a8989 Add unit test for the work around. 2017-01-25 14:15:41 -08:00
Pengfei Ni
d4bfcd1fda kubelet/dockershim: update cri to protobuf v3 2017-01-20 09:55:37 +08:00
Pengfei Ni
f584ed4398 Fix package aliases to follow golang convention 2016-11-30 15:40:50 +08:00
Yu-Ju Hong
8a6285d844 CRI: Rename container/sandbox states
The enum constants are not namespaced. The shorter, unspecifc names are likely
to cause naming conflicts in the future.

Also replace "SandBox" with "Sandbox" in the API.
2016-11-01 13:18:21 -07:00
Random-Liu
121a91eb12 Symlink docker logs to CRI defined log path. 2016-10-23 19:08:47 -07:00
Ivan Shvedunov
f1258dca4e Fix typos 2016-10-15 00:21:00 +03:00
Kubernetes Submit Queue
b99a9094cc Merge pull request #34380 from Random-Liu/fix-cri-image
Automatic merge from submit-queue

CRI: Image pullable support in dockershim

For #33189.

The new test `ImageID should be set to the manifest digest (from RepoDigests) when available` introduced in #33014 is failing, because:
1) `docker-pullable://` conversion is not supported in dockershim;
2) `kuberuntime` and `dockershim` is using `ListImages with image name filter` to check whether image presents. However, `ListImages` doesn't support filter with `digest`.

This PR:
1) Change `kuberuntime.IsImagePresent` to use `runtime.ImageStatus` and `dockershim.InspectImage` instead. ***Notice an API change: `ImageStatus` should return `(nil, nil)` for non-existing image.***
2) Add `docker-pullable://` support.
3) Fix `RemoveImage` in dockershim https://github.com/kubernetes/kubernetes/pull/29316.

I've tried myself, the test can pass now.

@yujuhong @feiskyer @yifan-gu 
/cc @kubernetes/sig-node
2016-10-12 12:25:37 -07:00
Random-Liu
afa3414779 * Add docker pullable support.
* Fix inspect image bug.
* Fix remove image bug.
2016-10-12 09:21:10 -07:00
Random-Liu
13459411c1 Change dockershim to use UnixNano instead of Unix. 2016-10-11 14:50:55 -07:00
Random-Liu
76056a47f9 Change the timestamp unit to nanosecond. 2016-10-07 14:10:19 -07:00
Random-Liu
c3ce58b934 Implement temporary ImageStats in kuberuntime_manager, and
fix a bug in dockershim which causes summary api not working
properly.
2016-10-03 22:56:25 -07:00
Kubernetes Submit Queue
a241daf3f2 Merge pull request #33500 from Random-Liu/apparmor-seccomp-cri
Automatic merge from submit-queue

Add seccomp and apparmor support.

This PR adds seccomp and apparmor support in new CRI.

This a WIP because I'm still adding unit test for some of the functions. Sent this PR here for design discussion.

This PR is similar with https://github.com/kubernetes/kubernetes/pull/33450.
The differences are:
* This PR passes seccomp and apparmor configuration via annotations;
* This PR keeps the seccomp handling logic in docker shim because current seccomp implementation is very docker specific, and @timstclair told me that even the json seccomp profile file is defined by docker.

Notice that this PR almost passes related annotations in `api.Pod` to the runtime directly instead of introducing new CRI annotation.

@yujuhong @feiskyer @timstclair
2016-10-03 20:34:13 -07:00
Random-Liu
37273693e5 Fix bug in dockershim to set sandbox id properly. 2016-10-01 20:55:06 -07:00
Random-Liu
0771e64ab8 Add unit test for get security option functions. 2016-09-28 18:38:23 -07:00
Random-Liu
3d1263d2cf Use fakeclock in fake docker client. 2016-09-24 22:43:39 -07:00
Yu-Ju Hong
737769954a CRI: add Message in ContainerStatus
Kubernetes expects a brief CamelCase string as "Reason" and a human-readable
string as "Message" in the conatiner status. It is difficult for kubelet to
derive the other one if the runtime only provides one of the two fields.
Augment the API by adding the "Message" field.
2016-09-23 14:32:54 -07:00
Yu-Ju Hong
2f60b72dd3 dockershim: add support for annotations 2016-09-16 11:31:15 -07:00
Yu-Ju Hong
d3e1f2c75e dockershim: add unit tests for sandbox/container status
Also add a fake clock in the FakeDockerClient to allow testing container
CreatedAt, StartedAt, FinishedAt timestamps.
2016-09-13 10:32:28 -07:00
Wojciech Tyczynski
3a0112f6ee Revert "dockershim: add unit tests for sandbox/container status" 2016-09-13 09:01:19 +02:00
Yu-Ju Hong
0075e9dbee dockershim: add unit tests for sandbox/container status
Also add a fake clock in the FakeDockerClient to allow testing container
CreatedAt, StartedAt, FinishedAt timestamps.
2016-09-12 12:55:49 -07:00