mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
add test for finalizers
This commit is contained in:
parent
b1143da370
commit
b95191fe10
@ -180,6 +180,27 @@ func TestSkipPodUpdate(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "with changes on Finalizers",
|
||||||
|
pod: &v1.Pod{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: "pod-0",
|
||||||
|
Finalizers: []string{"a", "b"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
isAssumedPodFunc: func(*v1.Pod) bool {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
getPodFunc: func(*v1.Pod) *v1.Pod {
|
||||||
|
return &v1.Pod{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: "pod-0",
|
||||||
|
Finalizers: []string{"c", "d"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
expected: true,
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
c := &Scheduler{
|
c := &Scheduler{
|
||||||
|
Loading…
Reference in New Issue
Block a user