Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions workflow/controller/taskset.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ func (woc *wfOperationCtx) createTaskSet(ctx context.Context) error {
}

woc.log.Info("Creating TaskSet")
labels := map[string]string{}
if woc.controller.Config.InstanceID != "" {
labels[common.LabelKeyControllerInstanceID] = woc.controller.Config.InstanceID
}
taskSet := wfv1.WorkflowTaskSet{
TypeMeta: metav1.TypeMeta{
Kind: workflow.WorkflowTaskSetKind,
Expand All @@ -181,6 +185,7 @@ func (woc *wfOperationCtx) createTaskSet(ctx context.Context) error {
ObjectMeta: metav1.ObjectMeta{
Namespace: woc.wf.Namespace,
Name: woc.wf.Name,
Labels: labels,
OwnerReferences: []metav1.OwnerReference{
{
APIVersion: woc.wf.APIVersion,
Expand Down
1 change: 1 addition & 0 deletions workflow/controller/taskset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ spec:
assert.Equal(t, ts.Name, wf.Name)
assert.Equal(t, ts.Namespace, wf.Namespace)
assert.Len(t, ts.Spec.Tasks, 1)
assert.Equal(t, "testID", ts.Labels[common.LabelKeyControllerInstanceID], "WorkflowTaskSet should have instanceID label")
}
pods, err := woc.controller.kubeclientset.CoreV1().Pods("default").List(ctx, v1.ListOptions{})
require.NoError(t, err)
Expand Down
Loading