Fix: correct GetCondition doc comment to describe value return (#7223)

ConditionedStatus.GetCondition returns a value-typed Condition, not a
pointer, so it can never return nil. On a missing ConditionType it returns
a Condition of that type with status Unknown. Update the doc comment, which
still described the old crossplane-runtime pointer contract, to match the
actual behavior.

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
This commit is contained in:
Anas Khan
2026-07-23 05:01:02 +05:30
committed by GitHub
parent 39183d5ba3
commit 39541de387

View File

@@ -122,8 +122,8 @@ func NewConditionedStatus(c ...Condition) *ConditionedStatus {
return s
}
// GetCondition returns the condition for the given ConditionType if exists,
// otherwise returns nil
// GetCondition returns the condition for the given ConditionType if it exists,
// otherwise it returns a Condition of that type with status Unknown.
func (s *ConditionedStatus) GetCondition(ct ConditionType) Condition {
for _, c := range s.Conditions {
if c.Type == ct {