Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Jeev B <[email protected]>
  • Loading branch information
jeevb committed Nov 21, 2023
1 parent 236846e commit f684b0d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,16 @@ func (tensorflowOperatorResourceHandler) BuildResource(ctx context.Context, task
kubeflowv1.TFJobReplicaTypeEval: kfTensorflowTaskExtraArgs.GetEvaluatorReplicas(),
}
for t, cfg := range replicaSpecCfgMap {
// Short circuit if replica set has no replicas to avoid unnecessarily
// generating pod specs
if cfg.GetReplicas() <= 0 {
continue
}
rs, err := common.ToReplicaSpecWithOverrides(ctx, taskCtx, cfg, kubeflowv1.TFJobDefaultContainerName, false)
if err != nil {
return nil, flyteerr.Errorf(flyteerr.BadTaskSpecification, "Unable to create replica spec: [%v]", err.Error())
}
if rs != nil && *rs.Replicas > 0 {
replicaSpecMap[t] = rs
}
replicaSpecMap[t] = rs
}

if kfTensorflowTaskExtraArgs.GetRunPolicy() != nil {
Expand Down

0 comments on commit f684b0d

Please sign in to comment.