Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #655 from hex108/evicit
Browse files Browse the repository at this point in the history
Do graceful eviction using default policy
  • Loading branch information
k8s-ci-robot authored Mar 21, 2019
2 parents 4203ba0 + 965e988 commit bd25e0f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,9 @@ type defaultEvictor struct {
}

func (de *defaultEvictor) Evict(p *v1.Pod) error {
// TODO (k82cn): makes grace period configurable.
threeSecs := int64(3)

glog.V(3).Infof("Evicting pod %v/%v", p.Namespace, p.Name)

if err := de.kubeclient.CoreV1().Pods(p.Namespace).Delete(p.Name, &metav1.DeleteOptions{
GracePeriodSeconds: &threeSecs,
}); err != nil {
if err := de.kubeclient.CoreV1().Pods(p.Namespace).Delete(p.Name, nil); err != nil {
glog.Errorf("Failed to evict pod <%v/%v>: %#v", p.Namespace, p.Name, err)
return err
}
Expand Down

0 comments on commit bd25e0f

Please sign in to comment.