From 39541de38793fd0a026aca09934e340c825c36d3 Mon Sep 17 00:00:00 2001 From: Anas Khan Date: Thu, 23 Jul 2026 05:01:02 +0530 Subject: [PATCH] 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> --- apis/core.oam.dev/condition/condition.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/core.oam.dev/condition/condition.go b/apis/core.oam.dev/condition/condition.go index b386fc997..9f3fe8b7d 100644 --- a/apis/core.oam.dev/condition/condition.go +++ b/apis/core.oam.dev/condition/condition.go @@ -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 {