diff --git a/controllers/common.go b/controllers/common.go index a194793..0d831b5 100644 --- a/controllers/common.go +++ b/controllers/common.go @@ -32,7 +32,6 @@ import ( const ( workflowNameSuffix = "-workflow-counter" jobNameStepInfix = "-workflow-step-" - logDirNameInfix = "-workflow-step-" envVarsConfigMapinfix = "-env-vars-step-" customDataConfigMapinfix = "-custom-data-step-" workflowStepNumInvalid = -1 @@ -179,7 +178,7 @@ func (r *Reconciler) GetJobName(instance interface{}, workflowStepNum int) strin workflowStepName = typedInstance.Spec.Workflow[workflowStepNum].StepName } - return typedInstance.Name + "-" + workflowStepName + jobNameStepInfix + strconv.Itoa(workflowStepNum) + return typedInstance.Name + jobNameStepInfix + fmt.Sprintf("%02d", workflowStepNum) + "-" + workflowStepName } else if typedInstance, ok := instance.(*v1beta1.Tempest); ok { if len(typedInstance.Spec.Workflow) == 0 || workflowStepNum == workflowStepNumInvalid { return typedInstance.Name @@ -190,7 +189,7 @@ func (r *Reconciler) GetJobName(instance interface{}, workflowStepNum int) strin workflowStepName = typedInstance.Spec.Workflow[workflowStepNum].StepName } - return typedInstance.Name + "-" + workflowStepName + jobNameStepInfix + strconv.Itoa(workflowStepNum) + return typedInstance.Name + jobNameStepInfix + fmt.Sprintf("%02d", workflowStepNum) + "-" + workflowStepName } else if typedInstance, ok := instance.(*v1beta1.HorizonTest); ok { return typedInstance.Name } else if typedInstance, ok := instance.(*v1beta1.AnsibleTest); ok { @@ -203,7 +202,7 @@ func (r *Reconciler) GetJobName(instance interface{}, workflowStepNum int) strin workflowStepName = typedInstance.Spec.Workflow[workflowStepNum].StepName } - return typedInstance.Name + "-" + workflowStepName + jobNameStepInfix + strconv.Itoa(workflowStepNum) + return typedInstance.Name + jobNameStepInfix + fmt.Sprintf("%02d", workflowStepNum) + "-" + workflowStepName } return workflowStepNameInvalid