Skip to content

Commit

Permalink
Adding cascading delete of pods when jobs are deleted (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnugeorge authored and k8s-ci-robot committed Jun 4, 2019
1 parent 03fb85e commit b0e0dd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/v1alpha2/trial/trial_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (r *ReconcileTrial) reconcileJob(instance *trialsv1alpha2.Trial, desiredJob
}
} else {
if instance.IsCompleted() && !instance.Spec.RetainRun {
if err = r.Delete(context.TODO(), desiredJob); err != nil {
if err = r.Delete(context.TODO(), desiredJob, client.PropagationPolicy(metav1.DeletePropagationForeground)); err != nil {
logger.Error(err, "Delete job error")
return nil, err
} else {
Expand Down Expand Up @@ -351,7 +351,7 @@ func (r *ReconcileTrial) reconcileMetricsCollector(instance *trialsv1alpha2.Tria
}
} else {
if instance.IsCompleted() && !instance.Spec.RetainMetricsCollector {
if err = r.Delete(context.TODO(), desiredMetricsCollector); err != nil {
if err = r.Delete(context.TODO(), desiredMetricsCollector, client.PropagationPolicy(metav1.DeletePropagationForeground)); err != nil {
logger.Error(err, "Delete Metrics Collector error")
return nil, err
} else {
Expand Down

0 comments on commit b0e0dd5

Please sign in to comment.