mirror of
https://github.com/kubevela/kubevela.git
synced 2026-07-28 09:53:01 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user