Get returns the condition with the given type from the resource. If the condition does not exist, nil is returned.
(on Getter, conditionType string)
| 23 | // Get returns the condition with the given type from the resource. If the |
| 24 | // condition does not exist, nil is returned. |
| 25 | func Get(on Getter, conditionType string) *metav1.Condition { |
| 26 | if on == nil { |
| 27 | return nil |
| 28 | } |
| 29 | |
| 30 | for _, condition := range on.GetConditions() { |
| 31 | if condition.Type == conditionType { |
| 32 | return &condition |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | return nil |
| 37 | } |
| 38 | |
| 39 | // Set updates the conditions on the given resource. If a condition with the |
| 40 | // same type already exists, it is replaced. If the condition is new, it is |