Skip to content

Commit

Permalink
Merge pull request flyteorg#47 from lyft/mtoledo/set-k8s-array-args
Browse files Browse the repository at this point in the history
use args instead of cmd
  • Loading branch information
migueltol22 authored Jan 23, 2020
2 parents 93e0b8d + a500749 commit 2f54e67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/tasks/plugins/array/k8s/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func LaunchSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, kubeCli
return currentState, errors2.Wrapf(ErrBuildPodTemplate, err, "Failed to convert task template to a pod template for task")
}

var command []string
var args []string
if len(podTemplate.Spec.Containers) > 0 {
command = append(podTemplate.Spec.Containers[0].Command, podTemplate.Spec.Containers[0].Args...)
podTemplate.Spec.Containers[0].Args = []string{}
args = append(podTemplate.Spec.Containers[0].Command, podTemplate.Spec.Containers[0].Args...)
podTemplate.Spec.Containers[0].Command = []string{}
}

size := currentState.GetExecutionArraySize()
Expand All @@ -87,7 +87,7 @@ func LaunchSubTasks(ctx context.Context, tCtx core.TaskExecutionContext, kubeCli

pod.Spec.Containers[0].Env = append(pod.Spec.Containers[0].Env, arrayJobEnvVars...)

pod.Spec.Containers[0].Command, err = utils.ReplaceTemplateCommandArgs(ctx, command, arrayJobInputReader{tCtx.InputReader()}, tCtx.OutputWriter())
pod.Spec.Containers[0].Args, err = utils.ReplaceTemplateCommandArgs(ctx, args, arrayJobInputReader{tCtx.InputReader()}, tCtx.OutputWriter())
if err != nil {
return currentState, errors2.Wrapf(ErrReplaceCmdTemplate, err, "Failed to replace cmd args")
}
Expand Down

0 comments on commit 2f54e67

Please sign in to comment.