Skip to content

Commit e28a213

Browse files
committed
Add small refactor change in build nginx plus
1 parent d853fef commit e28a213

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/mode/static/state/dataplane/configuration.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,9 @@ func buildNginxPlus(g *graph.Graph) NginxPlus {
10041004
ngfProxy := g.NginxProxy
10051005
if ngfProxy != nil && ngfProxy.Source.Spec.NginxPlus != nil {
10061006
if ngfProxy.Source.Spec.NginxPlus.AllowedAddresses != nil {
1007-
addresses := make([]string, len(ngfProxy.Source.Spec.NginxPlus.AllowedAddresses))
1008-
for i, addr := range ngfProxy.Source.Spec.NginxPlus.AllowedAddresses {
1009-
addresses[i] = addr.Value
1007+
addresses := make([]string, 0, len(ngfProxy.Source.Spec.NginxPlus.AllowedAddresses))
1008+
for _, addr := range ngfProxy.Source.Spec.NginxPlus.AllowedAddresses {
1009+
addresses = append(addresses, addr.Value)
10101010
}
10111011

10121012
nginxPlusSettings.AllowedAddresses = addresses

0 commit comments

Comments
 (0)