Skip to content

Commit

Permalink
Make a copy of WF labels before updating it for Nodes (flyteorg#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
surindersinghp authored Dec 12, 2019
1 parent ae2f2f0 commit cafc60b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flytepropeller/pkg/controller/nodes/node_exec_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ func (e execContext) GetLabels() map[string]string {

func newNodeExecContext(_ context.Context, store *storage.DataStore, w v1alpha1.ExecutableWorkflow, node v1alpha1.ExecutableNode, nodeStatus v1alpha1.ExecutableNodeStatus, inputs io.InputReader, maxDatasetSize int64, er events.TaskEventRecorder, tr handler.TaskReader, nsm *nodeStateManager, enqueueOwner func() error) *execContext {
md := execMetadata{WorkflowMeta: w}
nodeLabels := md.GetLabels()
if nodeLabels == nil {
nodeLabels = make(map[string]string)

// Copying the labels before updating it for this node
nodeLabels := make(map[string]string)
for k, v := range md.GetLabels() {
nodeLabels[k] = v
}
nodeLabels[NodeIDLabel] = utils.SanitizeLabelValue(node.GetID())
if tr != nil && tr.GetTaskID() != nil {
Expand Down

0 comments on commit cafc60b

Please sign in to comment.