Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change my TODO format to be the same with others #19215

Merged
merged 1 commit into from
Dec 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/kubelet/container/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
return true
}

// TODO (random-liu) This should be removed soon after rkt implements GetPodStatus.
// TODO(random-liu): This should be removed soon after rkt implements GetPodStatus.
func ShouldContainerBeRestartedOldVersion(container *api.Container, pod *api.Pod, podStatus *api.PodStatus) bool {
// Get all dead container status.
var resultStatus []*api.ContainerStatus
Expand Down Expand Up @@ -99,7 +99,7 @@ func ShouldContainerBeRestartedOldVersion(container *api.Container, pod *api.Pod
return true
}

// TODO (random-liu) Convert PodStatus to running Pod, should be deprecated soon
// TODO(random-liu): Convert PodStatus to running Pod, should be deprecated soon
func ConvertPodStatusToRunningPod(podStatus *PodStatus) Pod {
runningPod := Pod{
ID: podStatus.ID,
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubelet/container/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type Runtime interface {
// GarbageCollect removes dead containers using the specified container gc policy
GarbageCollect(gcPolicy ContainerGCPolicy) error
// Syncs the running pod into the desired pod.
// TODO (random-liu) The runningPod will be removed after #17420 is done.
// TODO(random-liu): The runningPod will be removed after #17420 is done.
SyncPod(pod *api.Pod, runningPod Pod, apiPodStatus api.PodStatus, podStatus *PodStatus, pullSecrets []api.Secret, backOff *util.Backoff) error
// KillPod kills all the containers of a pod. Pod may be nil, running pod must not be.
KillPod(pod *api.Pod, runningPod Pod) error
Expand All @@ -108,7 +108,7 @@ type Runtime interface {
// for all container runtimes in kubelet and remove this funciton.
ConvertPodStatusToAPIPodStatus(*api.Pod, *PodStatus) (*api.PodStatus, error)
// Return both PodStatus and api.PodStatus, this is just a temporary function.
// TODO (random-liu) Remove this method later
// TODO(random-liu): Remove this method later
GetPodStatusAndAPIPodStatus(*api.Pod) (*PodStatus, *api.PodStatus, error)
// PullImage pulls an image from the network to local storage using the supplied
// secrets if necessary.
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/dockertools/fake_docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (f *FakeDockerClient) ListContainers(options docker.ListContainersOptions)
if options.All {
// Althought the container is not sorted, but the container with the same name should be in order,
// that is enough for us now.
// TODO (random-liu) Is a fully sorted array needed?
// TODO(random-liu): Is a fully sorted array needed?
containerList = append(containerList, f.ExitedContainerList...)
}
return containerList, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/dockertools/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type labelledContainerInfo struct {
}

func newLabels(container *api.Container, pod *api.Pod, restartCount int) map[string]string {
// TODO (random-liu) Move more label initialization here
// TODO(random-liu): Move more label initialization here
labels := map[string]string{}
labels[kubernetesPodNameLabel] = pod.Name
labels[kubernetesPodNamespaceLabel] = pod.Namespace
Expand Down
12 changes: 6 additions & 6 deletions pkg/kubelet/dockertools/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func (dm *DockerManager) ConvertPodStatusToAPIPodStatus(pod *api.Pod, podStatus
}

containerDone := sets.NewString()
// NOTE: (random-liu) The Pod IP is generated in kubelet.generatePodStatus(), we have no podStatus.IP now
// NOTE(random-liu): The Pod IP is generated in kubelet.generatePodStatus(), we have no podStatus.IP now
apiPodStatus.PodIP = podStatus.IP
for _, containerStatus := range podStatus.ContainerStatuses {
cName := containerStatus.Name
Expand Down Expand Up @@ -1224,7 +1224,7 @@ func (dm *DockerManager) GetContainerIP(containerID, interfaceName string) (stri
return string(out), nil
}

// TODO: (random-liu) Change running pod to pod status in the future. We can't do it now, because kubelet also uses this function without pod status.
// TODO(random-liu): Change running pod to pod status in the future. We can't do it now, because kubelet also uses this function without pod status.
// We can only deprecate this after refactoring kubelet.
func (dm *DockerManager) KillPod(pod *api.Pod, runningPod kubecontainer.Pod) error {
// Send the kills in parallel since they may take a long time. Len + 1 since there
Expand Down Expand Up @@ -1776,7 +1776,7 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ kubecontainer.Pod, _ api.PodSta
}

// Killing phase: if we want to start new infra container, or nothing is running kill everything (including infra container)
// TODO: (random-liu) We'll use pod status directly in the future
// TODO(random-liu): We'll use pod status directly in the future
if err := dm.KillPod(pod, kubecontainer.ConvertPodStatusToRunningPod(podStatus)); err != nil {
return err
}
Expand All @@ -1786,7 +1786,7 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, _ kubecontainer.Pod, _ api.PodSta
for _, containerStatus := range runningContainerStatues {
_, keep := containerChanges.ContainersToKeep[kubetypes.DockerID(containerStatus.ID.ID)]
if !keep {
// NOTE: (random-liu) Just log ID or log container status here?
// NOTE(random-liu): Just log ID or log container status here?
glog.V(3).Infof("Killing unwanted container %+v", containerStatus)
// attempt to find the appropriate container policy
var podContainer *api.Container
Expand Down Expand Up @@ -2042,8 +2042,8 @@ func (dm *DockerManager) GetPodStatus(uid types.UID, name, namespace string) (*k
var containerStatuses []*kubecontainer.ContainerStatus
// We have added labels like pod name and pod namespace, it seems that we can do filtered list here.
// However, there may be some old containers without these labels, so at least now we can't do that.
// TODO (random-liu) Do only one list and pass in the list result in the future
// TODO (random-liu) Add filter when we are sure that all the containers have the labels
// TODO(random-liu): Do only one list and pass in the list result in the future
// TODO(random-liu): Add filter when we are sure that all the containers have the labels
containers, err := dm.client.ListContainers(docker.ListContainersOptions{All: true})
if err != nil {
return podStatus, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,7 @@ func GetPhase(spec *api.PodSpec, info []api.ContainerStatus) api.PodPhase {

// By passing the pod directly, this method avoids pod lookup, which requires
// grabbing a lock.
// TODO (random-liu) api.PodStatus is named as podStatus, this maybe confusing, this may happen in other functions
// TODO(random-liu): api.PodStatus is named as podStatus, this maybe confusing, this may happen in other functions
// after refactoring, modify them later.
func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) {

Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/runonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {

// isPodRunning returns true if all containers of a manifest are running.
func (kl *Kubelet) isPodRunning(pod *api.Pod, runningPod container.Pod) (bool, error) {
// TODO (random-liu) Change this to new pod status
// TODO(random-liu): Change this to new pod status
status, err := kl.containerRuntime.GetAPIPodStatus(pod)
if err != nil {
glog.Infof("Failed to get the status of pod %q: %v", format.Pod(pod), err)
Expand Down