Skip to content

Commit 7709548

Browse files
controller: update is node done check to handle image mode disabling case
1 parent 7a56cf0 commit 7709548

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/controller/common/layered_node_state.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ func NewLayeredNodeState(n *corev1.Node) *LayeredNodeState {
2626
return &LayeredNodeState{node: n}
2727
}
2828

29-
// Checks if the node is done "working" and that the node is targeting is MachineConfig
30-
// determined by the pool. If in layered mode, the image annotations are also checked
31-
// checked against the OCL objects.
29+
// Checks if the node is done "working." For a node in both layered and non-layered MCPs, the
30+
// node's state annotation must be "Done" and it must be targeting the correct MachineConfig. For
31+
// `layered` MCPs, the node's desired image annotation must match the image defined in the
32+
// MachineOsConfig and the desired MachineConfig must match the config version defined in the
33+
// MachineOSBuild. For non-layered MCPs, the node must not have a desired image annotation value.
3234
func (l *LayeredNodeState) IsDone(mcp *mcfgv1.MachineConfigPool, layered bool, mosc *mcfgv1.MachineOSConfig, mosb *mcfgv1.MachineOSBuild) bool {
3335
if layered {
3436
return l.IsNodeDone() && l.IsDesiredMachineConfigEqualToPool(mcp) && l.IsDesiredEqualToBuild(mosc, mosb)
3537
}
36-
return l.IsNodeDone() && l.IsDesiredMachineConfigEqualToPool(mcp)
38+
return l.IsNodeDone() && l.IsDesiredMachineConfigEqualToPool(mcp) && !l.IsDesiredImageAnnotationPresentOnNode()
3739
}
3840

3941
// The original behavior of getUnavailableMachines is: getUnavailableMachines

0 commit comments

Comments
 (0)