Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Add container Exec support. #115

Merged

Conversation

Random-Liu
Copy link
Member

@Random-Liu Random-Liu commented Aug 7, 2017

This PR:

  1. Vendored Kubernetes streaming server inside cri-containerd, which will be used for all container streaming operations: Exec, Portforward, Attach.
  2. Added container Exec support.
  3. Enabled Exec CRI validation test.

/cc @kubernetes-incubator/maintainers-cri-containerd

Signed-off-by: Lantao Liu <lantaol@google.com>
@Random-Liu Random-Liu added this to the v0.2.0 milestone Aug 7, 2017
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple questions and one nit.

@@ -100,16 +149,11 @@ func (c *criContainerdService) ExecSync(ctx context.Context, r *runtime.ExecSync
if err != nil {
return nil, fmt.Errorf("failed to wait for exec in container %q to finish: %v", id, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always throw out the exit code if there is an error? unknownExitCode?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should let waitContainerExec also return pointer, so that we don't need the unknownExitStatus for now.

We don't use the exit code when there is an error now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right.. just trying to figure out if that's on purpose. Seems at least possible to have an exit code and an error. Not a fan of throwing it out unless we need to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -84,6 +86,8 @@ type criContainerdService struct {
// imageStoreService is the containerd service to store and track
// image metadata.
imageStoreService images.Store
// eventsService is the containerd task service client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious why this one is better up here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just group containerd services together. No particular reason. :)

return c, nil
}

func (c *criContainerdService) Start() {
c.startEventMonitor()
go func() {
if err := c.streamServer.Start(true); err != nil {
glog.Errorf("Failed to start streaing server: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/s/streaing/streaming/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Signed-off-by: Lantao Liu <lantaol@google.com>
@Random-Liu
Copy link
Member Author

@mikebrow Addressed comments.

Signed-off-by: Lantao Liu <lantaol@google.com>
Signed-off-by: Lantao Liu <lantaol@google.com>
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@mikebrow mikebrow added the lgtm label Aug 7, 2017
@Random-Liu Random-Liu merged commit be54e9a into containerd:master Aug 8, 2017
@Random-Liu Random-Liu deleted the support-container-streaming branch August 8, 2017 00:04
@Random-Liu Random-Liu mentioned this pull request Aug 17, 2017
42 tasks
lanchongyizu pushed a commit to lanchongyizu/cri-containerd that referenced this pull request Sep 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants