Skip to content

Commit

Permalink
update based on reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
salonichf5 committed Jul 15, 2024
1 parent 506c197 commit 5fe59f5
Show file tree
Hide file tree
Showing 6 changed files with 709 additions and 976 deletions.
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/config/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func executeServers(conf dataplane.Configuration) []executeResult {

// getIPFamily returns whether the server should be configured for IPv4, IPv6, or both.
func getIPFamily(baseHTTPConfig dataplane.BaseHTTPConfig) http.IPFamily {
switch ip := baseHTTPConfig.IPFamily; ip {
switch baseHTTPConfig.IPFamily {
case dataplane.IPv4:
return http.IPFamily{IPv4: true}
case dataplane.IPv6:
Expand Down
6 changes: 4 additions & 2 deletions internal/mode/static/state/dataplane/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,10 @@ func getAllowedAddressType(ipFamily IPFamilyType) []discoveryV1.AddressType {
return []discoveryV1.AddressType{discoveryV1.AddressTypeIPv4}
case IPv6:
return []discoveryV1.AddressType{discoveryV1.AddressTypeIPv6}
default:
case Dual:
return []discoveryV1.AddressType{discoveryV1.AddressTypeIPv4, discoveryV1.AddressTypeIPv6}
default:
return []discoveryV1.AddressType{}
}
}

Expand Down Expand Up @@ -686,7 +688,7 @@ func buildBaseHTTPConfig(g *graph.Graph) BaseHTTPConfig {
}

if g.NginxProxy.Source.Spec.IPFamily != nil {
switch ipFamily := g.NginxProxy.Source.Spec.IPFamily; *ipFamily {
switch *g.NginxProxy.Source.Spec.IPFamily {
case ngfAPI.IPv4:
baseConfig.IPFamily = IPv4
case ngfAPI.IPv6:
Expand Down
Loading

0 comments on commit 5fe59f5

Please sign in to comment.