Skip to content

Commit

Permalink
Add small refactor change in build nginx plus
Browse files Browse the repository at this point in the history
  • Loading branch information
bjee19 committed Jan 30, 2025
1 parent 05ab72d commit 6b1861d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/mode/static/state/dataplane/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,9 @@ func buildNginxPlus(g *graph.Graph) NginxPlus {
ngfProxy := g.NginxProxy
if ngfProxy != nil && ngfProxy.Source.Spec.NginxPlus != nil {
if ngfProxy.Source.Spec.NginxPlus.AllowedAddresses != nil {
addresses := make([]string, len(ngfProxy.Source.Spec.NginxPlus.AllowedAddresses))
for i, addr := range ngfProxy.Source.Spec.NginxPlus.AllowedAddresses {
addresses[i] = addr.Value
addresses := make([]string, 0, len(ngfProxy.Source.Spec.NginxPlus.AllowedAddresses))
for _, addr := range ngfProxy.Source.Spec.NginxPlus.AllowedAddresses {
addresses = append(addresses, addr.Value)
}

nginxPlusSettings.AllowedAddresses = addresses
Expand Down

0 comments on commit 6b1861d

Please sign in to comment.