Skip to content

Commit 851d778

Browse files
committed
address review comments
1 parent 90cc954 commit 851d778

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

pkg/kubelet/container/runtime.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type Runtime interface {
114114
GetContainerLogs(ctx context.Context, pod *v1.Pod, containerID ContainerID, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) (err error)
115115
// Delete a container. If the container is still running, an error is returned.
116116
DeleteContainer(containerID ContainerID) error
117-
// Delete a sandbox. If the container is still running, an error is returned.
117+
// DeleteSandbox deletes a sandbox.
118118
DeleteSandbox(sandboxID string) error
119119
// ImageService provides methods to image-related methods.
120120
ImageService
@@ -311,7 +311,7 @@ type Status struct {
311311
// Name of the container.
312312
Name string
313313
// ID of the sandbox to which this container belongs.
314-
PodSandboxId string
314+
PodSandboxID string
315315
// Status of the container.
316316
State State
317317
// Creation time of the container.

pkg/kubelet/kuberuntime/kuberuntime_container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ func (m *kubeGenericRuntimeManager) getPodContainerStatuses(uid kubetypes.UID, n
474474
cStatus.Message += tMessage
475475
}
476476
}
477-
cStatus.PodSandboxId = c.PodSandboxId
477+
cStatus.PodSandboxID = c.PodSandboxId
478478
statuses[i] = cStatus
479479
}
480480

pkg/kubelet/kuberuntime/kuberuntime_sandbox.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@ func (m *kubeGenericRuntimeManager) GetPortForward(podName, podNamespace string,
305305
return url.Parse(resp.Url)
306306
}
307307

308-
// DeleteSandbox removes the sandbox by sandboxID..
308+
// DeleteSandbox removes the sandbox by sandboxID.
309309
func (m *kubeGenericRuntimeManager) DeleteSandbox(sandboxID string) error {
310310
klog.V(4).Infof("Removing sandbox %q", sandboxID)
311-
// the stop sandbox is called as part of kill pod but the error is ignored. So,
312-
// we have to call stop sandbox again to make sure that all the resources like
313-
// netwrork are cleaned by runtime.
311+
// stop sandbox is called as part of kill pod function but the error is ignored. So,
312+
// we have to call stop sandbox again to make sure that all the resources like network
313+
// are cleaned by runtime.
314314
if err := m.runtimeService.StopPodSandbox(sandboxID); err != nil {
315315
return err
316316
}

pkg/kubelet/pod_sandbox_deleter.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ func (a sandboxStatusByCreatedList) Less(i, j int) bool {
4646
func newPodSandboxDeleter(runtime kubecontainer.Runtime) *podSandboxDeleter {
4747
buffer := make(chan string, sandboxDeletionBufferLimit)
4848
go wait.Forever(func() {
49-
for {
50-
id := <-buffer
49+
for id := range buffer {
5150
if err := runtime.DeleteSandbox(id); err != nil {
5251
klog.Warningf("[pod_sandbox_deleter] DeleteSandbox returned error for (id=%v): %v", id, err)
5352
}
@@ -64,7 +63,7 @@ func newPodSandboxDeleter(runtime kubecontainer.Runtime) *podSandboxDeleter {
6463
func (p *podSandboxDeleter) deleteSandboxesInPod(podStatus *kubecontainer.PodStatus, toKeep int) {
6564
sandboxIDs := sets.NewString()
6665
for _, containerStatus := range podStatus.ContainerStatuses {
67-
sandboxIDs.Insert(containerStatus.PodSandboxId)
66+
sandboxIDs.Insert(containerStatus.PodSandboxID)
6867
}
6968
sandboxStatuses := podStatus.SandboxStatuses
7069
if toKeep > 0 {

0 commit comments

Comments
 (0)