@@ -373,13 +373,13 @@ func isNodeDone(node *corev1.Node, layered bool) bool {
373
373
return false
374
374
}
375
375
376
- if layered {
377
- // The MachineConfig annotations are loaded on boot-up by the daemon which
378
- // isn't currently done for the image annotations, so the comparisons here
379
- // are a bit more nuanced.
380
- cimage , cok := node .Annotations [daemonconsts .CurrentImageAnnotationKey ]
381
- dimage , dok := node .Annotations [daemonconsts .DesiredImageAnnotationKey ]
376
+ // The MachineConfig annotations are loaded on boot-up by the daemon which
377
+ // isn't currently done for the image annotations, so the comparisons here
378
+ // are a bit more nuanced.
379
+ cimage , cok := node .Annotations [daemonconsts .CurrentImageAnnotationKey ]
380
+ dimage , dok := node .Annotations [daemonconsts .DesiredImageAnnotationKey ]
382
381
382
+ if layered {
383
383
// If desired image is not set, but the pool is layered, this node can
384
384
// be considered ready for an update. This is the very first time node
385
385
// is being opted into layering.
@@ -398,6 +398,15 @@ func isNodeDone(node *corev1.Node, layered bool) bool {
398
398
399
399
}
400
400
401
+ // If not in layered mode, we also need to consider the case when the node is rolling back
402
+ // from layered to non-layered. In those cases, cconfig==dconfig, but the node
403
+ // will still need to do an update back to dconfig's OSImageURL. We can detect a
404
+ // rolling back node by checking if the cimage stills exists but the dimage does not exist.
405
+ if cok && ! dok {
406
+ // The node is not "done" in this case, as the current image annotation still exists.
407
+ return false
408
+ }
409
+
401
410
return cconfig == dconfig && isNodeMCDState (node , daemonconsts .MachineConfigDaemonStateDone )
402
411
}
403
412
0 commit comments