Skip to content

Commit 4c5a795

Browse files
cleanup
1 parent 94b88cc commit 4c5a795

File tree

5 files changed

+0
-23
lines changed

5 files changed

+0
-23
lines changed

pkg/controller/drain/drain_controller.go

-2
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ func (ctrl *Controller) handleErr(err error, key string) {
268268
ctrl.queue.AddAfter(key, 1*time.Minute)
269269
}
270270

271-
// TODO: look into idea of passing poolname into this function to apply to mcn
272271
func (ctrl *Controller) syncNode(key string) error {
273-
klog.Errorf("in syncNode with key: %v", key)
274272
startTime := time.Now()
275273
klog.V(4).Infof("Started syncing node %q (%v)", key, startTime)
276274
defer func() {

pkg/controller/node/node_controller.go

-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,6 @@ func (ctrl *Controller) updateNode(old, cur interface{}) {
610610
ctrl.logPoolNode(pool, curNode, "changed from pool %s", oldPool.Name)
611611
// Let's also make sure the old pool node counts/status get updated
612612
ctrl.enqueueMachineConfigPool(oldPool)
613-
// Update the node's MCN to reference the new pool
614613
} else if err != nil {
615614
// getPrimaryPoolForNode may error due to multiple custom pools. In this scenario, let's
616615
// queue all of them so that when the node attempts to exit from this error state, the MCP

pkg/daemon/drain.go

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func (dn *Daemon) performDrain() error {
4848
return err
4949
}
5050

51-
// err = upgrademonitor.GenerateAndApplyMachineConfigNodes(
5251
err = upgrademonitor.GenerateAndApplyMachineConfigNodes(
5352
&upgrademonitor.Condition{State: mcfgalphav1.MachineConfigNodeUpdateExecuted, Reason: string(mcfgalphav1.MachineConfigNodeUpdateDrained), Message: "Node Drain Not required for this update."},
5453
&upgrademonitor.Condition{State: mcfgalphav1.MachineConfigNodeUpdateDrained, Reason: fmt.Sprintf("%s%s", string(mcfgalphav1.MachineConfigNodeUpdateExecuted), string(mcfgalphav1.MachineConfigNodeUpdateDrained)), Message: "Node Drain Not required for this update."},

pkg/daemon/update.go

-10
Original file line numberDiff line numberDiff line change
@@ -1213,16 +1213,6 @@ func (dn *Daemon) update(oldConfig, newConfig *mcfgv1.MachineConfig, skipCertifi
12131213
if err != nil {
12141214
klog.Errorf("Error making MCN for Update Compatible: %v", err)
12151215
}
1216-
// TODO: delete in cleanup; pools can be targeted by labels other than those starting with "node-role.kubernetes.io/""
1217-
// pool := ""
1218-
// var ok bool
1219-
// if dn.node != nil {
1220-
// if _, ok = dn.node.Labels["node-role.kubernetes.io/worker"]; ok {
1221-
// pool = "worker"
1222-
// } else if _, ok = dn.node.Labels["node-role.kubernetes.io/master"]; ok {
1223-
// pool = "master"
1224-
// }
1225-
// }
12261216

12271217
err = upgrademonitor.GenerateAndApplyMachineConfigNodeSpec(dn.featureGatesAccessor, pool, dn.node, dn.mcfgClient)
12281218
if err != nil {

pkg/upgrademonitor/upgrade_monitor.go

-9
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,6 @@ func generateAndApplyMachineConfigNodes(
106106
return nil
107107
}
108108

109-
// TODO: delete in cleanup; pools can be targeted by labels other than those starting with "node-role.kubernetes.io/""
110-
// var pool string
111-
// var ok bool
112-
// if _, ok = node.Labels["node-role.kubernetes.io/worker"]; ok {
113-
// pool = "worker"
114-
// } else if _, ok = node.Labels["node-role.kubernetes.io/master"]; ok {
115-
// pool = "master"
116-
// }
117-
118109
// get the existing MCN, or if it DNE create one below
119110
mcNode, needNewMCNode := createOrGetMachineConfigNode(mcfgClient, node)
120111
newMCNode := mcNode.DeepCopy()

0 commit comments

Comments
 (0)