Skip to content

Commit

Permalink
fix the same issue in pod and service under TFJobController
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanYiLin committed Aug 12, 2018
1 parent bf74595 commit 62ae492
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controller.v2/tfcontroller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (tc *TFJobController) reconcilePods(
}
if pod.Status.Phase == v1.PodFailed && train_util.IsRetryableExitCode(exitCode) {
logger.Infof("Need to restart the pod: %s-%d", rt, index)
if err := tc.PodControl.DeletePod(pod.Namespace, pod.Name, tfjob); err != nil {
if err := tc.JobController.PodControl.DeletePod(pod.Namespace, pod.Name, tfjob); err != nil {
return err
}
restart = true
Expand Down Expand Up @@ -171,7 +171,7 @@ func (tc *TFJobController) createNewPod(tfjob *tfv1alpha2.TFJob, rt, index strin
}
setRestartPolicy(podTemplate, spec)

err = tc.PodControl.CreatePodsWithControllerRef(tfjob.Namespace, podTemplate, tfjob, controllerRef)
err = tc.JobController.PodControl.CreatePodsWithControllerRef(tfjob.Namespace, podTemplate, tfjob, controllerRef)
if err != nil && errors.IsTimeout(err) {
// Pod is created but its initialization has timed out.
// If the initialization is successful eventually, the
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v2/tfcontroller/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (tc *TFJobController) createNewService(tfjob *tfv1alpha2.TFJob, rtype tfv1a
service.Name = jobcontroller.GenGeneralName(tfjob.Name, rt, index)
service.Labels = labels

err = tc.ServiceControl.CreateServicesWithControllerRef(tfjob.Namespace, service, tfjob, controllerRef)
err = tc.JobController.ServiceControl.CreateServicesWithControllerRef(tfjob.Namespace, service, tfjob, controllerRef)
if err != nil && errors.IsTimeout(err) {
// Service is created but its initialization has timed out.
// If the initialization is successful eventually, the
Expand Down

0 comments on commit 62ae492

Please sign in to comment.