Skip to content

Commit

Permalink
Set restart policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ScorpioCPH committed Mar 22, 2018
1 parent e438720 commit a375ae5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/controller_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ func (tc *TFJobController) reconcilePods(
})
}

// Set restart policy
if spec.RestartPolicy != "" && spec.RestartPolicy != "ExitCode" {
pTemplate.Spec.RestartPolicy = v1.RestartPolicy(spec.RestartPolicy)
}

err := tc.podControl.CreatePodsWithControllerRef(tfjob.Namespace, pTemplate, tfjob, controllerRef)
if err != nil && errors.IsTimeout(err) {
// Pod is created but its initialization has timed out.
Expand Down

0 comments on commit a375ae5

Please sign in to comment.