Skip to content

Commit b52b90d

Browse files
committed
update based on reviews
1 parent 2ea4db6 commit b52b90d

File tree

6 files changed

+709
-976
lines changed

6 files changed

+709
-976
lines changed

internal/mode/static/nginx/config/servers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func executeServers(conf dataplane.Configuration) []executeResult {
9393

9494
// getIPFamily returns whether the server should be configured for IPv4, IPv6, or both.
9595
func getIPFamily(baseHTTPConfig dataplane.BaseHTTPConfig) http.IPFamily {
96-
switch ip := baseHTTPConfig.IPFamily; ip {
96+
switch baseHTTPConfig.IPFamily {
9797
case dataplane.IPv4:
9898
return http.IPFamily{IPv4: true}
9999
case dataplane.IPv6:

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,10 @@ func getAllowedAddressType(ipFamily IPFamilyType) []discoveryV1.AddressType {
542542
return []discoveryV1.AddressType{discoveryV1.AddressTypeIPv4}
543543
case IPv6:
544544
return []discoveryV1.AddressType{discoveryV1.AddressTypeIPv6}
545-
default:
545+
case Dual:
546546
return []discoveryV1.AddressType{discoveryV1.AddressTypeIPv4, discoveryV1.AddressTypeIPv6}
547+
default:
548+
return []discoveryV1.AddressType{}
547549
}
548550
}
549551

@@ -686,7 +688,7 @@ func buildBaseHTTPConfig(g *graph.Graph) BaseHTTPConfig {
686688
}
687689

688690
if g.NginxProxy.Source.Spec.IPFamily != nil {
689-
switch ipFamily := g.NginxProxy.Source.Spec.IPFamily; *ipFamily {
691+
switch *g.NginxProxy.Source.Spec.IPFamily {
690692
case ngfAPI.IPv4:
691693
baseConfig.IPFamily = IPv4
692694
case ngfAPI.IPv6:

0 commit comments

Comments
 (0)