From 60e28a9460e8416e39c50e2e8e9b695173aa5c5c Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Sat, 27 May 2017 00:31:30 +0000 Subject: [PATCH] Minor cleanup. Signed-off-by: Lantao Liu --- pkg/server/events.go | 1 + pkg/server/sandbox_remove.go | 3 ++- pkg/server/sandbox_stop.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/server/events.go b/pkg/server/events.go index 8d4d82998..bb28fd04a 100644 --- a/pkg/server/events.go +++ b/pkg/server/events.go @@ -49,6 +49,7 @@ func (c *criContainerdService) startEventMonitor() error { func (c *criContainerdService) handleEventStream(events execution.ContainerService_EventsClient) { // TODO(random-liu): [P1] Should backoff on this error, or else this will // cause a busy loop. + // TODO(random-liu): Handle io.EOF. e, err := events.Recv() if err != nil { glog.Errorf("Failed to receive event: %v", err) diff --git a/pkg/server/sandbox_remove.go b/pkg/server/sandbox_remove.go index bc03050be..e40c1d944 100644 --- a/pkg/server/sandbox_remove.go +++ b/pkg/server/sandbox_remove.go @@ -35,7 +35,7 @@ func (c *criContainerdService) RemovePodSandbox(ctx context.Context, r *runtime. glog.V(2).Infof("RemovePodSandbox for sandbox %q", r.GetPodSandboxId()) defer func() { if retErr == nil { - glog.V(2).Info("RemovePodSandbox %q returns successfully", r.GetPodSandboxId()) + glog.V(2).Infof("RemovePodSandbox %q returns successfully", r.GetPodSandboxId()) } }() @@ -65,6 +65,7 @@ func (c *criContainerdService) RemovePodSandbox(ctx context.Context, r *runtime. return nil, fmt.Errorf("sandbox container %q is not fully stopped", id) } + // TODO(random-liu): [P0] Cleanup snapshot after switching to new snapshot api. // TODO(random-liu): [P0] Cleanup shm created in RunPodSandbox. // TODO(random-liu): [P1] Remove permanent namespace once used. diff --git a/pkg/server/sandbox_stop.go b/pkg/server/sandbox_stop.go index a2b6e23b0..934708ffe 100644 --- a/pkg/server/sandbox_stop.go +++ b/pkg/server/sandbox_stop.go @@ -34,7 +34,7 @@ func (c *criContainerdService) StopPodSandbox(ctx context.Context, r *runtime.St glog.V(2).Infof("StopPodSandbox for sandbox %q", r.GetPodSandboxId()) defer func() { if retErr == nil { - glog.V(2).Info("StopPodSandbox %q returns successfully", r.GetPodSandboxId()) + glog.V(2).Infof("StopPodSandbox %q returns successfully", r.GetPodSandboxId()) } }() @@ -56,7 +56,7 @@ func (c *criContainerdService) StopPodSandbox(ctx context.Context, r *runtime.St } else if !os.IsNotExist(err) { // It's ok for sandbox.NetNS to *not* exist return nil, fmt.Errorf("failed to stat netns path for sandbox %q before tearing down the network: %v", id, err) } - glog.V(2).Info("TearDown network for sandbox %q successfully", id) + glog.V(2).Infof("TearDown network for sandbox %q successfully", id) // TODO(random-liu): [P1] Handle sandbox container graceful deletion. // Delete the sandbox container from containerd.