Description
What would you like to be added (User Story)?
As a developer, I would like to retain condition Reason when aggregating conditions because it can help us locate the issue by checking the Reason string.
Detailed Description
In CAPI v1beta2, the top-level Cluster resource aggregates unexpected condition statuses from underlying resources. For example, the ControlPlaneMachinesReady condition consolidates the Ready condition of all control plane machines, highlighting any unready machines.
However, when merging condition messages, the Reason field is not included by default. This behavior is defined in the merge strategy implementation.
This omission presents a challenge when diagnosing issues. If an infrastructure provider reports an error via a condition in infra machine resource, only the condition message propagates to the top-level Cluster resource. Consequently, when building an operator that interacts solely with the Cluster resource, we must rely on message parsing and pattern matching to infer the root cause, which is inefficient and error-prone.
By preserving both the Reason and Message fields during condition merging, we can retain structured and concise error information. The short Reason string provides a standardized way to identify failure categories, improving debugging and automation.
Anything else you would like to add?
No response
Label(s) to be applied
/kind feature
/area conditions