Merge pull request #273 from hongchaodeng/d
k8s: delete pod with 0 grace period
This commit is contained in:
Коммит
d43ca24adf
|
@ -60,7 +60,7 @@ func (m *Monkeys) CrushPods(ctx context.Context, ns string, ls labels.Selector,
|
|||
|
||||
// todo: kill multiple pods in one round?
|
||||
tokill := pods.Items[rand.Intn(len(pods.Items))].Name
|
||||
err = m.k8s.Pods(ns).Delete(tokill, nil)
|
||||
err = m.k8s.Pods(ns).Delete(tokill, api.NewDeleteOptions(0))
|
||||
if err != nil {
|
||||
logrus.Errorf("failed to kill pod %v: %v", tokill, err)
|
||||
continue
|
||||
|
|
|
@ -427,7 +427,7 @@ func (c *Cluster) removePodAndService(name string) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
err = c.kclient.Pods(c.namespace).Delete(name, nil)
|
||||
err = c.kclient.Pods(c.namespace).Delete(name, k8sapi.NewDeleteOptions(0))
|
||||
if err != nil {
|
||||
if !k8sutil.IsKubernetesResourceNotFoundError(err) {
|
||||
return err
|
||||
|
|
|
@ -225,7 +225,7 @@ func waitSizeReachedWithFilter(f *framework.Framework, clusterName string, size,
|
|||
|
||||
func killMembers(f *framework.Framework, names ...string) error {
|
||||
for _, name := range names {
|
||||
err := f.KubeClient.Pods(f.Namespace.Name).Delete(name, nil)
|
||||
err := f.KubeClient.Pods(f.Namespace.Name).Delete(name, api.NewDeleteOptions(0))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче