mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
Add observedGeneration and validation to pod status and conditions
This commit is contained in:
@@ -13897,6 +13897,50 @@ func TestValidatePodStatusUpdate(t *testing.T) {
|
||||
err string
|
||||
test string
|
||||
}{{
|
||||
*podtest.MakePod("foo",
|
||||
podtest.SetStatus(core.PodStatus{
|
||||
ObservedGeneration: 1,
|
||||
}),
|
||||
),
|
||||
*podtest.MakePod("foo"),
|
||||
"",
|
||||
"set valid status.observedGeneration",
|
||||
}, {
|
||||
*podtest.MakePod("foo",
|
||||
podtest.SetStatus(core.PodStatus{
|
||||
Conditions: []core.PodCondition{{
|
||||
Type: core.PodScheduled,
|
||||
Status: core.ConditionTrue,
|
||||
ObservedGeneration: 1,
|
||||
}},
|
||||
}),
|
||||
),
|
||||
*podtest.MakePod("foo"),
|
||||
"",
|
||||
"set valid condition.observedGeneration",
|
||||
}, {
|
||||
*podtest.MakePod("foo",
|
||||
podtest.SetStatus(core.PodStatus{
|
||||
ObservedGeneration: -1,
|
||||
}),
|
||||
),
|
||||
*podtest.MakePod("foo"),
|
||||
"status.observedGeneration: Invalid value: -1: must be a non-negative integer",
|
||||
"set invalid status.observedGeneration",
|
||||
}, {
|
||||
*podtest.MakePod("foo",
|
||||
podtest.SetStatus(core.PodStatus{
|
||||
Conditions: []core.PodCondition{{
|
||||
Type: core.PodScheduled,
|
||||
Status: core.ConditionTrue,
|
||||
ObservedGeneration: -1,
|
||||
}},
|
||||
}),
|
||||
),
|
||||
*podtest.MakePod("foo"),
|
||||
"status.conditions[0].observedGeneration: Invalid value: -1: must be a non-negative integer",
|
||||
"set invalid condition.observedGeneration",
|
||||
}, {
|
||||
*podtest.MakePod("foo",
|
||||
podtest.SetNodeName("node1"),
|
||||
podtest.SetStatus(core.PodStatus{
|
||||
|
||||
Reference in New Issue
Block a user