mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
SetCondtion updates generation
This commit is contained in:
parent
8bc8b11bcf
commit
5712e33abc
@ -51,6 +51,7 @@ func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Cond
|
|||||||
|
|
||||||
existingCondition.Reason = newCondition.Reason
|
existingCondition.Reason = newCondition.Reason
|
||||||
existingCondition.Message = newCondition.Message
|
existingCondition.Message = newCondition.Message
|
||||||
|
existingCondition.ObservedGeneration = newCondition.ObservedGeneration
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveStatusCondition removes the corresponding conditionType from conditions.
|
// RemoveStatusCondition removes the corresponding conditionType from conditions.
|
||||||
|
@ -68,10 +68,10 @@ func TestSetStatusCondition(t *testing.T) {
|
|||||||
{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}},
|
{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}},
|
||||||
{Type: "third"},
|
{Type: "third"},
|
||||||
},
|
},
|
||||||
toAdd: metav1.Condition{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourAfter}, Reason: "reason", Message: "message"},
|
toAdd: metav1.Condition{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourAfter}, Reason: "reason", Message: "message", ObservedGeneration: 3},
|
||||||
expected: []metav1.Condition{
|
expected: []metav1.Condition{
|
||||||
{Type: "first"},
|
{Type: "first"},
|
||||||
{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message"},
|
{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message", ObservedGeneration: 3},
|
||||||
{Type: "third"},
|
{Type: "third"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user