Skip to content

Commit 3a8c305

Browse files
committed
Only include nodeName in static pod node controller's apply config.
NodeStatuses has list-type=map which allows different field managers (in particular the installer controller) to manage different fields within a single entry. Including the other fields in the node controller's apply configuration based on the version observed by the lister will effectively revert any more recent but not-yet-observed writes.
1 parent 6018a90 commit 3a8c305

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

pkg/operator/staticpod/controller/node/node_controller.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,7 @@ func (c *NodeController) sync(ctx context.Context, syncCtx factory.SyncContext)
9696
}
9797
}
9898
if found {
99-
newTargetNodeState := applyoperatorv1.NodeStatus().
100-
WithNodeName(originalOperatorStatus.NodeStatuses[i].NodeName).
101-
WithCurrentRevision(originalOperatorStatus.NodeStatuses[i].CurrentRevision).
102-
WithTargetRevision(originalOperatorStatus.NodeStatuses[i].TargetRevision).
103-
WithLastFailedRevision(originalOperatorStatus.NodeStatuses[i].LastFailedRevision).
104-
WithLastFailedReason(originalOperatorStatus.NodeStatuses[i].LastFailedReason).
105-
WithLastFailedCount(originalOperatorStatus.NodeStatuses[i].LastFailedCount).
106-
WithLastFallbackCount(originalOperatorStatus.NodeStatuses[i].LastFallbackCount).
107-
WithLastFailedRevisionErrors(originalOperatorStatus.NodeStatuses[i].LastFailedRevisionErrors...)
108-
if originalOperatorStatus.NodeStatuses[i].LastFailedTime != nil {
109-
newTargetNodeState = newTargetNodeState.WithLastFailedTime(*originalOperatorStatus.NodeStatuses[i].LastFailedTime)
110-
}
99+
newTargetNodeState := applyoperatorv1.NodeStatus().WithNodeName(originalOperatorStatus.NodeStatuses[i].NodeName)
111100
newTargetNodeStates = append(newTargetNodeStates, newTargetNodeState)
112101
} else {
113102
syncCtx.Recorder().Warningf("MasterNodeRemoved", "Observed removal of master node %s", nodeState.NodeName)

0 commit comments

Comments
 (0)