Skip to content

Commit

Permalink
Keep old labels
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Sep 22, 2020
1 parent e41f971 commit 93ed19d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/burner/burner.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,12 @@ func yamlToUnstructured(y []byte, uns *unstructured.Unstructured) (runtime.Objec
}

func (ex *Executor) replicaHandler(objectIndex int, obj object, ns string, iteration int, wg *sync.WaitGroup) {
label := map[string]string{
labels := map[string]string{
"kube-burner-uuid": ex.uuid,
"kube-burner-job": ex.Config.Name,
"kube-burner-index": strconv.Itoa(objectIndex),
}

defer wg.Done()
tData := map[string]interface{}{
jobName: ex.Config.Name,
Expand All @@ -412,7 +413,10 @@ func (ex *Executor) replicaHandler(objectIndex int, obj object, ns string, itera
renderedObj := renderTemplate(obj.objectSpec, tData)
// Re-decode rendered object
yamlToUnstructured(renderedObj, newObject)
newObject.SetLabels(label)
for k, v := range newObject.GetLabels() {
labels[k] = v
}
newObject.SetLabels(labels)
wg.Add(1)
go func() {
// We are using the same wait group for this inner goroutine, maybe we should consider using a new one
Expand Down

0 comments on commit 93ed19d

Please sign in to comment.