Skip to content

Commit

Permalink
feat: submit from workflowtemplate (#2120)
Browse files Browse the repository at this point in the history
* feat: submit from workflowtemplate

Signed-off-by: Derek Wang <[email protected]>
  • Loading branch information
whynowy committed Sep 10, 2022
1 parent cd23dde commit ea02369
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sensors/triggers/argo-workflow/argo-workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,16 @@ func (t *ArgoWorkflowTrigger) Execute(ctx context.Context, events map[string]*v1
}
cmd = exec.Command("argo", "-n", namespace, "submit", file.Name())
case v1alpha1.SubmitFrom:
wf := obj.GetKind()
switch strings.ToLower(wf) {
kind := obj.GetKind()
switch strings.ToLower(kind) {
case "cronworkflow":
wf = "cronwf"
case "workflow":
wf = "wf"
kind = "cronwf"
case "workflowtemplate":
kind = "workflowtemplate"
default:
return nil, errors.Errorf("invalid kind %s", wf)
return nil, errors.Errorf("invalid kind %s", kind)
}
fromArg := fmt.Sprintf("%s/%s", wf, name)
fromArg := fmt.Sprintf("%s/%s", kind, name)
cmd = exec.Command("argo", "-n", namespace, "submit", "--from", fromArg)
case v1alpha1.Resubmit:
cmd = exec.Command("argo", "-n", namespace, "resubmit", name)
Expand Down

0 comments on commit ea02369

Please sign in to comment.