-
Notifications
You must be signed in to change notification settings - Fork 347
Switch to new containerd api #78
Switch to new containerd api #78
Conversation
Signed-off-by: Mike Brown <[email protected]>
Signed-off-by: Mike Brown <[email protected]>
|
I've tested this with #72, #77. The test result is not changed: @kubernetes-incubator/maintainers-cri-containerd |
|
@mikebrow Let's try to get this merge soon, so as to unblock your client change. I'll rebase other PRs after this one is merged. |
Signed-off-by: Lantao Liu <[email protected]>
Signed-off-by: Lantao Liu <[email protected]>
2e25466 to
6ee7269
Compare
| sandboxID := meta.SandboxID | ||
| // Make sure sandbox is running. | ||
| sandboxInfo, err := c.containerService.Info(ctx, &execution.InfoRequest{ContainerID: sandboxID}) | ||
| sandboxInfo, err := c.taskService.Info(ctx, &execution.InfoRequest{ContainerID: sandboxID}) |
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.
Yeah wasn't sure how far we wanted to push the use of the term "task" as a replacement for "container" given that task isn't in CRI/Kube and really is just a new naming convention for docker/containerd. So I only changed it where it "had" to change.
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.
Because containerd also has container notion, which is the metadata + task of the container, it may cause some naming conflict or confusion if we don't follow the same pattern. :)
That's fine, we'll have a separate PR to do the cleanup.
pkg/server/container_create.go
Outdated
| } | ||
|
|
||
| // Generate container runtime spec. | ||
| mounts := c.generateContainerMounts(getSandboxRootDir(c.rootDir, sandbox.ID), config) |
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.
Not sure why the cached sandboxID was created.. but it's not being used consistently here.
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.
Good catch, will fix.
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.
| return &runtime.CreateContainerResponse{ContainerId: id}, nil | ||
| } | ||
|
|
||
| func (c *criContainerdService) generateContainerSpec(id string, sandboxPid uint32, config *runtime.ContainerConfig, |
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.
Makes sense that this code needed to move from start to create given the containerd changes... but it makes it hard to review :-)
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.
Yeah, pure code move. No change except the unit test.
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.
No issues found. Well done! See one nit... but otherwise let's go ahead and merge this so we can move forward.
LGTM
Signed-off-by: Lantao Liu <[email protected]>
Signed-off-by: Lantao Liu <[email protected]>
Signed-off-by: Lantao Liu <[email protected]>
6ee7269 to
d643599
Compare
|
Apply LGTM based on #78 (review). Thanks for reviewing and also thanks for the initial commits! |
…nerd-client Switch to new containerd api
Based on #68.
Update containerd to 4ae34cccc5b496c6547ff28dbeed1bde4773fa7a, and integrate with new containerd API.
Note that this PR doesn't use containerd client. We'll switch to containerd client later.