Browse Source

修改bug

yjp 3 months ago
parent
commit
5361db4221
1 changed files with 3 additions and 1 deletions
  1. 3 1
      approve_former/flow_template.go

+ 3 - 1
approve_former/flow_template.go

@@ -7,7 +7,7 @@ import (
 )
 )
 
 
 const workflowTemplateTpl = `
 const workflowTemplateTpl = `
-[[- $workflowTemplateName := .name -]]
+[[- $workflowTemplateName := .real_workflow_name -]]
 [[- $rootChildren := .children -]]
 [[- $rootChildren := .children -]]
 
 
 apiVersion: argoproj.io/v1alpha1
 apiVersion: argoproj.io/v1alpha1
@@ -60,6 +60,8 @@ func ParseWorkflowTemplate(name string, templateParams map[string]any) (string,
 		return "", errors.New(err.Error())
 		return "", errors.New(err.Error())
 	}
 	}
 
 
+	templateParams["real_workflow_name"] = name
+
 	buffer := &bytes.Buffer{}
 	buffer := &bytes.Buffer{}
 	err = tpl.Execute(buffer, templateParams)
 	err = tpl.Execute(buffer, templateParams)
 	if err != nil {
 	if err != nil {