Skip to content

Commit 47943d5

Browse files
authored
Merge pull request kubernetes#94109 from derekwaynecarr/cleanup-kubelet-todos
Cleanup kubelet TODOs that are no longer pertinent.
2 parents 68f6b09 + 02daa3e commit 47943d5

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

pkg/kubelet/kubelet.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const (
137137
housekeepingPeriod = time.Second * 2
138138

139139
// Period for performing eviction monitoring.
140-
// TODO ensure this is in sync with internal cadvisor housekeeping.
140+
// ensure this is kept in sync with internal cadvisor housekeeping.
141141
evictionMonitoringPeriod = time.Second * 10
142142

143143
// The path in containers' filesystems where the hosts file is mounted.
@@ -442,9 +442,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
442442
}
443443
nodeLister := corelisters.NewNodeLister(nodeIndexer)
444444

445-
// TODO: get the real node object of ourself,
446-
// and use the real node name and UID.
447-
// TODO: what is namespace for node?
445+
// construct a node reference used for events
448446
nodeRef := &v1.ObjectReference{
449447
Kind: "Node",
450448
Name: string(nodeName),
@@ -958,8 +956,6 @@ type Kubelet struct {
958956
streamingRuntime kubecontainer.StreamingRuntime
959957

960958
// Container runtime service (needed by container runtime Start()).
961-
// TODO(CD): try to make this available without holding a reference in this
962-
// struct. For example, by adding a getter to generic runtime.
963959
runtimeService internalapi.RuntimeService
964960

965961
// reasonCache caches the failure reason of the last creation of all containers, which is
@@ -1079,7 +1075,6 @@ type Kubelet struct {
10791075
// maintains Node.Spec.Unschedulable value from previous run of tryUpdateNodeStatus()
10801076
lastNodeUnschedulable bool
10811077

1082-
// TODO: think about moving this to be centralized in PodWorkers in follow-on.
10831078
// the list of handlers to call during pod admission.
10841079
admitHandlers lifecycle.PodAdmitHandlers
10851080

@@ -1337,7 +1332,6 @@ func (kl *Kubelet) initializeModules() error {
13371332
func (kl *Kubelet) initializeRuntimeDependentModules() {
13381333
if err := kl.cadvisor.Start(); err != nil {
13391334
// Fail kubelet and rely on the babysitter to retry starting kubelet.
1340-
// TODO(random-liu): Add backoff logic in the babysitter
13411335
klog.Fatalf("Failed to start cAdvisor %v", err)
13421336
}
13431337

@@ -1744,7 +1738,6 @@ func (kl *Kubelet) deletePod(pod *v1.Pod) error {
17441738
podPair := kubecontainer.PodPair{APIPod: pod, RunningPod: &runningPod}
17451739

17461740
kl.podKiller.KillPod(&podPair)
1747-
// TODO: delete the mirror pod here?
17481741

17491742
// We leave the volume/directory cleanup to the periodic cleanup routine.
17501743
return nil
@@ -2070,8 +2063,6 @@ func (kl *Kubelet) HandlePodUpdates(pods []*v1.Pod) {
20702063
kl.handleMirrorPod(pod, start)
20712064
continue
20722065
}
2073-
// TODO: Evaluate if we need to validate and reject updates.
2074-
20752066
mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod)
20762067
kl.dispatchWork(pod, kubetypes.SyncPodUpdate, mirrorPod, start)
20772068
}
@@ -2160,7 +2151,6 @@ func (kl *Kubelet) updateRuntimeUp() {
21602151
return
21612152
}
21622153
// Periodically log the whole runtime status for debugging.
2163-
// TODO(random-liu): Consider to send node event when optional
21642154
// condition is unmet.
21652155
klog.V(4).Infof("Container runtime status: %v", s)
21662156
networkReady := s.GetRuntimeCondition(kubecontainer.NetworkReady)

pkg/kubelet/kubelet_node_status.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ func (kl *Kubelet) tryUpdateNodeStatus(tryNumber int) error {
524524
// message for the node.
525525
func (kl *Kubelet) recordNodeStatusEvent(eventType, event string) {
526526
klog.V(2).Infof("Recording %s event message for node %s", event, kl.nodeName)
527-
// TODO: This requires a transaction, either both node status is updated
528-
// and event is recorded or neither should happen, see issue #6055.
529527
kl.recorder.Eventf(kl.nodeRef, eventType, event, "Node %s status is now: %s", kl.nodeName, event)
530528
}
531529

pkg/kubelet/kubelet_pods.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,6 @@ func containerResourceRuntimeValue(fs *v1.ResourceFieldSelector, pod *v1.Pod, co
834834
}
835835

836836
// One of the following arguments must be non-nil: runningPod, status.
837-
// TODO: Modify containerRuntime.KillPod() to accept the right arguments.
838837
func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *kubecontainer.PodStatus, gracePeriodOverride *int64) error {
839838
var p kubecontainer.Pod
840839
if runningPod != nil {
@@ -1095,7 +1094,6 @@ func (kl *Kubelet) HandlePodCleanups() error {
10951094
desiredPods[pod.UID] = sets.Empty{}
10961095
}
10971096
// Stop the workers for no-longer existing pods.
1098-
// TODO: is here the best place to forget pod workers?
10991097
kl.podWorkers.ForgetNonExistingPodWorkers(desiredPods)
11001098
kl.probeManager.CleanupPods(desiredPods)
11011099

0 commit comments

Comments
 (0)