From 0e377131edc40e30d4c13b1104315f98ecfbbf6a Mon Sep 17 00:00:00 2001 From: Derek Wang Date: Tue, 9 Aug 2022 23:18:50 -0700 Subject: [PATCH] feat: submit from workflowtemplate (#2120) * feat: submit from workflowtemplate Signed-off-by: Derek Wang Signed-off-by: Daniel Soifer --- sensors/triggers/argo-workflow/argo-workflow.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sensors/triggers/argo-workflow/argo-workflow.go b/sensors/triggers/argo-workflow/argo-workflow.go index 369a7f16e8..32b710efe3 100644 --- a/sensors/triggers/argo-workflow/argo-workflow.go +++ b/sensors/triggers/argo-workflow/argo-workflow.go @@ -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)