File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -208,11 +208,18 @@ func (cdp *ConsulDataplane) Run(ctx context.Context) error {
208208}
209209
210210func (cdp * ConsulDataplane ) envoyProxyConfig (cfg []byte ) envoy.ProxyConfig {
211- // Translate the concurrency parameter to the envoy parameter.
212- concurrency := fmt .Sprintf ("--concurrency %v" , cdp .cfg .Envoy .EnvoyConcurrency )
213- // Prepend so that if the consumer also specifies a concurrency level their specification should take
214- // precedence.
215- extraArgs := append ([]string {concurrency }, cdp .cfg .Envoy .ExtraArgs ... )
211+ setConcurrency := true
212+ extraArgs := cdp .cfg .Envoy .ExtraArgs
213+ // Users could set the concurrency as an extra args. Take that as priority for best ux
214+ // experience.
215+ for _ , v := range extraArgs {
216+ if v == "--concurrency" {
217+ setConcurrency = false
218+ }
219+ }
220+ if setConcurrency {
221+ extraArgs = append (extraArgs , fmt .Sprintf ("--concurrency %v" , cdp .cfg .Envoy .EnvoyConcurrency ))
222+ }
216223
217224 return envoy.ProxyConfig {
218225 Logger : cdp .logger ,
You can’t perform that action at this time.
0 commit comments