MCPcopy
hub / github.com/akuity/kargo / Get

Function Get

pkg/conditions/conditions.go:25–37  ·  view source on GitHub ↗

Get returns the condition with the given type from the resource. If the condition does not exist, nil is returned.

(on Getter, conditionType string)

Source from the content-addressed store, hash-verified

23// Get returns the condition with the given type from the resource. If the
24// condition does not exist, nil is returned.
25func 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

Calls 1

GetConditionsMethod · 0.65