Skip to content

Commit

Permalink
set annotation automatically when EnableGangScheduling is set to true (
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanYiLin authored and k8s-ci-robot committed Jun 24, 2019
1 parent fd76dee commit d746bde
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller.v1/tensorflow/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ func (tc *TFController) createNewPod(tfjob *tfv1.TFJob, rt, index string, spec *
} else {
podTemplate.Spec.SchedulerName = gangSchedulerName
}

if podTemplate.Annotations == nil {
podTemplate.Annotations = map[string]string{}
}
// we create the podGroup with the same name as the tfjob
podTemplate.Annotations["scheduling.k8s.io/group-name"] = tfjob.Name
}

err = tc.PodControl.CreatePodsWithControllerRef(tfjob.Namespace, podTemplate, tfjob, controllerRef)
Expand Down

0 comments on commit d746bde

Please sign in to comment.