Skip to content

Commit 02daa3e

Browse files
Cleanup kubelet TODOs that are no longer pertinent.
1 parent 544b74c commit 02daa3e

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
@@ -138,7 +138,7 @@ const (
138138
housekeepingPeriod = time.Second * 2
139139

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

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

443-
// TODO: get the real node object of ourself,
444-
// and use the real node name and UID.
445-
// TODO: what is namespace for node?
443+
// construct a node reference used for events
446444
nodeRef := &v1.ObjectReference{
447445
Kind: "Node",
448446
Name: string(nodeName),
@@ -948,8 +946,6 @@ type Kubelet struct {
948946
streamingRuntime kubecontainer.StreamingRuntime
949947

950948
// Container runtime service (needed by container runtime Start()).
951-
// TODO(CD): try to make this available without holding a reference in this
952-
// struct. For example, by adding a getter to generic runtime.
953949
runtimeService internalapi.RuntimeService
954950

955951
// reasonCache caches the failure reason of the last creation of all containers, which is
@@ -1069,7 +1065,6 @@ type Kubelet struct {
10691065
// maintains Node.Spec.Unschedulable value from previous run of tryUpdateNodeStatus()
10701066
lastNodeUnschedulable bool
10711067

1072-
// TODO: think about moving this to be centralized in PodWorkers in follow-on.
10731068
// the list of handlers to call during pod admission.
10741069
admitHandlers lifecycle.PodAdmitHandlers
10751070

@@ -1275,7 +1270,6 @@ func (kl *Kubelet) initializeModules() error {
12751270
func (kl *Kubelet) initializeRuntimeDependentModules() {
12761271
if err := kl.cadvisor.Start(); err != nil {
12771272
// Fail kubelet and rely on the babysitter to retry starting kubelet.
1278-
// TODO(random-liu): Add backoff logic in the babysitter
12791273
klog.Fatalf("Failed to start cAdvisor %v", err)
12801274
}
12811275

@@ -1680,7 +1674,6 @@ func (kl *Kubelet) deletePod(pod *v1.Pod) error {
16801674
podPair := kubecontainer.PodPair{APIPod: pod, RunningPod: &runningPod}
16811675

16821676
kl.podKiller.KillPod(&podPair)
1683-
// TODO: delete the mirror pod here?
16841677

16851678
// We leave the volume/directory cleanup to the periodic cleanup routine.
16861679
return nil
@@ -2003,8 +1996,6 @@ func (kl *Kubelet) HandlePodUpdates(pods []*v1.Pod) {
20031996
kl.handleMirrorPod(pod, start)
20041997
continue
20051998
}
2006-
// TODO: Evaluate if we need to validate and reject updates.
2007-
20081999
mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod)
20092000
kl.dispatchWork(pod, kubetypes.SyncPodUpdate, mirrorPod, start)
20102001
}
@@ -2093,7 +2084,6 @@ func (kl *Kubelet) updateRuntimeUp() {
20932084
return
20942085
}
20952086
// Periodically log the whole runtime status for debugging.
2096-
// TODO(random-liu): Consider to send node event when optional
20972087
// condition is unmet.
20982088
klog.V(4).Infof("Container runtime status: %v", s)
20992089
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
@@ -836,7 +836,6 @@ func containerResourceRuntimeValue(fs *v1.ResourceFieldSelector, pod *v1.Pod, co
836836
}
837837

838838
// One of the following arguments must be non-nil: runningPod, status.
839-
// TODO: Modify containerRuntime.KillPod() to accept the right arguments.
840839
func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *kubecontainer.PodStatus, gracePeriodOverride *int64) error {
841840
var p kubecontainer.Pod
842841
if runningPod != nil {
@@ -1087,7 +1086,6 @@ func (kl *Kubelet) HandlePodCleanups() error {
10871086
desiredPods[pod.UID] = sets.Empty{}
10881087
}
10891088
// Stop the workers for no-longer existing pods.
1090-
// TODO: is here the best place to forget pod workers?
10911089
kl.podWorkers.ForgetNonExistingPodWorkers(desiredPods)
10921090
kl.probeManager.CleanupPods(desiredPods)
10931091

0 commit comments

Comments
 (0)