From 46050682d594a9fc9533dde1382addb3c9a6ee33 Mon Sep 17 00:00:00 2001 From: Delyan Raychev Date: Wed, 6 Jan 2021 10:33:35 -0800 Subject: [PATCH] cds: Remove conditional always evaluating to true (#2261) Signed-off-by: Delyan Raychev --- pkg/envoy/cds/thresholds.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/envoy/cds/thresholds.go b/pkg/envoy/cds/thresholds.go index d3ed7169cc..8c50e073d8 100644 --- a/pkg/envoy/cds/thresholds.go +++ b/pkg/envoy/cds/thresholds.go @@ -11,15 +11,11 @@ func makeThresholds(maxConnections *uint32) []*xds_cluster.CircuitBreakers_Thres return nil } - threshold := &xds_cluster.CircuitBreakers_Thresholds{} - - if maxConnections != nil { - threshold.MaxConnections = &wrappers.UInt32Value{ - Value: *maxConnections, - } - } - return []*xds_cluster.CircuitBreakers_Thresholds{ - threshold, + { + MaxConnections: &wrappers.UInt32Value{ + Value: *maxConnections, + }, + }, } }