Skip to content

Commit

Permalink
Merge pull request #889 from Vafilor/fix/workspaces
Browse files Browse the repository at this point in the history
fix: incorrectly formatted label for workspaces
  • Loading branch information
rushtehrani authored Mar 3, 2021
2 parents a4dcbdf + 52e4117 commit 1424d24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions pkg/workflow_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ func (c *Client) injectAutomatedFields(namespace string, wf *wfv1.Workflow, opts
if template.Metadata.Labels == nil {
template.Metadata.Labels = make(map[string]string)
}
template.Metadata.Labels["onepanelio/entity-type"] = "Workflow"
template.Metadata.Labels["onepanelio/entity-uid"] = opts.GenerateName
template.Metadata.Labels["onepanel.io/entity-type"] = "Workflow"
template.Metadata.Labels["onepanel.io/entity-uid"] = opts.WorkflowTemplateUID
}
}

Expand Down Expand Up @@ -893,6 +893,7 @@ func (c *Client) CreateWorkflowExecution(namespace string, workflow *WorkflowExe
return nil, err
}
opts.GenerateName = nameUID + "-"
opts.WorkflowTemplateUID = workflowTemplate.UID

opts.Labels[workflowTemplateUIDLabelKey] = workflowTemplate.UID
opts.Labels[workflowTemplateVersionLabelKey] = fmt.Sprint(workflowTemplate.Version)
Expand Down
17 changes: 9 additions & 8 deletions pkg/workflow_execution_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ type WorkflowExecution struct {

// WorkflowExecutionOptions are options you have for an executing workflow
type WorkflowExecutionOptions struct {
Name string
GenerateName string
Entrypoint string
Parameters []Parameter
ServiceAccount string
Labels map[string]string
ListOptions *ListOptions
PodGCStrategy *PodGCStrategy
Name string
GenerateName string
Entrypoint string
Parameters []Parameter
ServiceAccount string
Labels map[string]string
ListOptions *ListOptions
PodGCStrategy *PodGCStrategy
WorkflowTemplateUID string
}

// WorkflowExecutionStatistic is a record keeping track of what happened to a workflow execution
Expand Down

0 comments on commit 1424d24

Please sign in to comment.