Using GenerateUID to clean up the names.

This commit is contained in:
Aleksandr Melnikov
2020-05-11 16:27:53 -07:00
committed by rushtehrani
parent 184bb1247d
commit 18a795f129
2 changed files with 15 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/onepanelio/core/pkg/util/label"
"github.com/onepanelio/core/pkg/util/pagination"
"github.com/onepanelio/core/pkg/util/ptr"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"io"
"io/ioutil"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
@@ -248,7 +249,10 @@ func (c *Client) createWorkflow(namespace string, workflowTemplateId uint64, wor
return 0, nil, err
}
uid := wf.Labels[label.WorkflowUid]
uid, err := uid2.GenerateUID(createdWorkflow.Name)
if err != nil {
return 0, nil, err
}
//Create an entry for workflow_executions statistic
//CURL code will hit the API endpoint that will update the db row
newDbId, err = c.insertPreWorkflowExecutionStatistic(namespace, createdWorkflow.Name, workflowTemplateVersionId, createdWorkflow.CreationTimestamp.UTC(), uid, opts.Parameters)