Set delete propagation policy to background when removing jobs and its dependents

This commit is contained in:
Maciej Szulik
2018-12-06 17:19:51 +01:00
parent 82b0d8fd37
commit 65e074fd1a
2 changed files with 20 additions and 5 deletions

View File

@@ -118,7 +118,8 @@ func (r realJobControl) CreateJob(namespace string, job *batchv1.Job) (*batchv1.
}
func (r realJobControl) DeleteJob(namespace string, name string) error {
return r.KubeClient.BatchV1().Jobs(namespace).Delete(name, nil)
background := metav1.DeletePropagationBackground
return r.KubeClient.BatchV1().Jobs(namespace).Delete(name, &metav1.DeleteOptions{PropagationPolicy: &background})
}
type fakeJobControl struct {