-
Notifications
You must be signed in to change notification settings - Fork 347
Add other small functions #53
Add other small functions #53
Conversation
2bbfe8e to
2259b61
Compare
2259b61 to
18227aa
Compare
| } | ||
| networkReady := &runtime.RuntimeCondition{ | ||
| Type: runtime.NetworkReady, | ||
| Status: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a TODO to check whether the plugins are ready or they exist? I didn't review the networking code, so this may not make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cri-containerd doesn't support cider allocation now (we are directly using cri-o cni plugin package now).
The networking team is also planing to deprecate kubenet. In the future, the cider should be handled by a daemonset outside of the container.
/cc @freehan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have to be CIDR. Network could be not ready if cri-containerd cannot find any network plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/server/status.go
Outdated
| // Status returns the status of the runtime. | ||
| func (c *criContainerdService) Status(ctx context.Context, r *runtime.StatusRequest) (*runtime.StatusResponse, error) { | ||
| return nil, errors.New("not implemented") | ||
| runtimeReady := &runtime.RuntimeCondition{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to check whether containerd is alive? E.g., call containerd version().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
… gomock. Signed-off-by: Lantao Liu <[email protected]>
026f5a1 to
be565d8
Compare
|
@yujuhong Addressed comments. |
| // Status returns the status of the runtime. | ||
| func (c *criContainerdService) Status(ctx context.Context, r *runtime.StatusRequest) (*runtime.StatusResponse, error) { | ||
| return nil, errors.New("not implemented") | ||
| runtimeCondition := &runtime.RuntimeCondition{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe check the health of the meta stores? For example, ListPodSandbox()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikebrow What do you mean by "meta store"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that which implements a MetadataStore..
SandboxStore, ImageMetadataStore, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it's checking whether containerd is working or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk
| // UpdateRuntimeConfig updates the runtime config. Currently only handles podCIDR updates. | ||
| func (c *criContainerdService) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateRuntimeConfigRequest) (*runtime.UpdateRuntimeConfigResponse, error) { | ||
| return nil, errors.New("not implemented") | ||
| return &runtime.UpdateRuntimeConfigResponse{}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this function now. In current dockershim, this is used to update pod CIDR, which we don't support now and may not support in the future.
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockershim/docker_service.go#L304-L315
We may have a separate daemonset to update the CIDR in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a comment or todo to investigate if / when we need to update.. Returning no error here with no update if they passed in something to be updated could lead the user astray?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| containerdAPIVersion = "0.0.0" | ||
| containerdVersion = "0.0.0" | ||
| // kubeAPIVersion is the api version of kubernetes. | ||
| kubeAPIVersion = "0.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple questions.. 1) Should / could this be set at build vs being hard coded? 2) Why kubeAPIVersion and not kubelet and / or kubelet/cri?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from dockershim.
This field doesn't make too much sense to me now, so just copied the code.
| // Containerd doesn't return semver because of a bug. | ||
| // TODO(random-liu): Replace this with version from containerd. | ||
| RuntimeVersion: containerdVersion, | ||
| // Containerd doesn't have an api version now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so containerd isn't going to follow the new docker/moby model for using the date to set the version and let the api version be the more traditional major change tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containerd won't use date to set version I think.
They should expose api version, but I think it's to early to them to talk about api version now, given that they are changing api everyday before GA.
Signed-off-by: Lantao Liu <[email protected]>
Signed-off-by: Lantao Liu <[email protected]>
be565d8 to
2df96e1
Compare
mikebrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LGTM |
|
@yujuhong Thanks for reviewing! |
|
Apply LGTM based on #53 (review) and #53 (comment). |
…tions Add other small functions
update to golang 1.13.4
Add
Version,UpdateRuntimeConfigandStatus.Based on #41, #46, #48 and #52. Only last 2 commits are new.
We could basically achieve our alpha goal after this PR is merged, and more tests are needed after code freeze. @yujuhong @dchen1107 @mikebrow
/cc @abgworrall @matchstick
With this PR, we could pass half CRI validation test now:
Failed tests are caused by: