Skip to content

Commit

Permalink
fix the bug of concurrent create snippet pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
littlejiancc committed Nov 22, 2021
1 parent 0d67328 commit 6259c3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/pipeline/services/pipelinesvc/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ func (s *PipelineSvc) MakeSnippetPipeline4Create(p *spec.Pipeline, snippetTask *
for k, v := range snippetTask.Extra.Action.Params {
runParams = append(runParams, apistructs.PipelineRunParam{Name: k, Value: v})
}
// solve concurrent problem
labels := make(map[string]string, len(p.Labels))
for k, v := range p.Labels {
labels[k] = v
}
// transfer snippetTask to pipeline create request
labels := p.Labels
for k, v := range snippetConfig.Labels {
labels[k] = v
}
Expand Down

0 comments on commit 6259c3b

Please sign in to comment.