update: updated tests to have method calls for particular cases. Added more tests.

This commit is contained in:
Andrey Melnikov
2020-07-01 16:07:20 -07:00
parent c5d1ec9b1f
commit ed621633df
11 changed files with 491 additions and 84 deletions

View File

@@ -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