Alter graceful deletion to not use TTL
Avoid TTL by deleting pods immediately when they aren't scheduled, and letting the Kubelet delete them otherwise. Ensure the Kubelet uses pod.Spec.TerminationGracePeriodSeconds when no pod.DeletionGracePeriodSeconds is available.
This commit is contained in:
@@ -1317,6 +1317,9 @@ func TestValidatePod(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidatePodUpdate(t *testing.T) {
|
||||
now := util.Now()
|
||||
grace := int64(30)
|
||||
grace2 := int64(31)
|
||||
tests := []struct {
|
||||
a api.Pod
|
||||
b api.Pod
|
||||
@@ -1403,6 +1406,30 @@ func TestValidatePodUpdate(t *testing.T) {
|
||||
false,
|
||||
"more containers",
|
||||
},
|
||||
{
|
||||
api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo", DeletionTimestamp: &now},
|
||||
Spec: api.PodSpec{Containers: []api.Container{{Image: "foo:V1"}}},
|
||||
},
|
||||
api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Spec: api.PodSpec{Containers: []api.Container{{Image: "foo:V1"}}},
|
||||
},
|
||||
true,
|
||||
"deletion timestamp filled out",
|
||||
},
|
||||
{
|
||||
api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo", DeletionTimestamp: &now, DeletionGracePeriodSeconds: &grace},
|
||||
Spec: api.PodSpec{Containers: []api.Container{{Image: "foo:V1"}}},
|
||||
},
|
||||
api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo", DeletionTimestamp: &now, DeletionGracePeriodSeconds: &grace2},
|
||||
Spec: api.PodSpec{Containers: []api.Container{{Image: "foo:V1"}}},
|
||||
},
|
||||
false,
|
||||
"deletion grace period seconds cleared",
|
||||
},
|
||||
{
|
||||
api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
|
Reference in New Issue
Block a user