mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-16 02:31:04 +08:00
update: updated tests to have method calls for particular cases. Added more tests.
This commit is contained in:
@@ -340,6 +340,7 @@ func (c *Client) ValidateWorkflowExecution(namespace string, manifest []byte) (e
|
||||
|
||||
// CreateWorkflowExecution creates an argo workflow execution and related resources.
|
||||
// If workflow.Name is set, it is used instead of a generated name.
|
||||
// If there is a parameter named "workflow-execution-name" in workflow.Parameters, it is set as the name.
|
||||
func (c *Client) CreateWorkflowExecution(namespace string, workflow *WorkflowExecution, workflowTemplate *WorkflowTemplate) (*WorkflowExecution, error) {
|
||||
opts := &WorkflowExecutionOptions{
|
||||
Labels: make(map[string]string),
|
||||
@@ -350,6 +351,10 @@ func (c *Client) CreateWorkflowExecution(namespace string, workflow *WorkflowExe
|
||||
opts.Name = workflow.Name
|
||||
}
|
||||
|
||||
if workflowExecutionName := workflow.GetParameterValue("workflow-execution-name"); workflowExecutionName != nil {
|
||||
opts.Name = *workflowExecutionName
|
||||
}
|
||||
|
||||
nameUID, err := uid2.GenerateUID(workflowTemplate.Name, 63)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user