Skip to content

Commit 5e8bc56

Browse files
Merge pull request #1907 from benluddy/staticpod-node-controller-no-installer-field-stomping
OCPBUGS-46372: Prevent node controller from stomping NodeStatus fields owned by installer controller
2 parents 6018a90 + 3a8c305 commit 5e8bc56

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)