Skip to content

Commit c2625ac

Browse files
committed
Fix dataplane defaults and typos
1 parent bdfba52 commit c2625ac

File tree

6 files changed

+10
-18
lines changed

6 files changed

+10
-18
lines changed

apis/v1alpha2/nginxproxy_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,11 @@ type DNSResolver struct {
374374
// +optional
375375
CacheTTL *v1alpha1.Duration `json:"cacheTTL,omitempty"`
376376

377-
// DisableIPv6 disables DisableIPv6 lookups.
377+
// DisableIPv6 disables IPv6 lookups.
378378
// If not specified, or set to false, IPv6 lookups will be enabled.
379379
//
380380
// +optional
381-
DisableIPv6 *bool `json:"ipv6,omitempty"`
381+
DisableIPv6 *bool `json:"disableIPv6,omitempty"`
382382

383383
// Addresses specifies the list of DNS server addresses.
384384
// Each address can be an IP address or hostname.

config/crd/bases/gateway.nginx.org_nginxproxies.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ spec:
104104
description: CacheTTL specifies how long to cache DNS responses.
105105
pattern: ^[0-9]{1,4}(ms|s|m|h)?$
106106
type: string
107-
ipv6:
107+
disableIPv6:
108108
description: |-
109-
DisableIPv6 disables DisableIPv6 lookups.
109+
DisableIPv6 disables IPv6 lookups.
110110
If not specified, or set to false, IPv6 lookups will be enabled.
111111
type: boolean
112112
timeout:

deploy/crds.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,9 @@ spec:
689689
description: CacheTTL specifies how long to cache DNS responses.
690690
pattern: ^[0-9]{1,4}(ms|s|m|h)?$
691691
type: string
692-
ipv6:
692+
disableIPv6:
693693
description: |-
694-
DisableIPv6 disables DisableIPv6 lookups.
694+
DisableIPv6 disables IPv6 lookups.
695695
If not specified, or set to false, IPv6 lookups will be enabled.
696696
type: boolean
697697
timeout:

examples/externalname-service/gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ spec:
3939
value: "1.1.1.1"
4040
timeout: "30s"
4141
cacheTTL: "60s"
42-
ipv6: true
42+
disableIPv6: false

internal/controller/state/dataplane/configuration.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,20 +1258,14 @@ func buildDNSResolverConfig(dnsResolver *ngfAPIv1alpha2.DNSResolver) *DNSResolve
12581258

12591259
if dnsResolver.Timeout != nil {
12601260
config.Timeout = string(*dnsResolver.Timeout)
1261-
} else {
1262-
config.Timeout = "30s"
12631261
}
12641262

12651263
if dnsResolver.CacheTTL != nil {
12661264
config.Valid = string(*dnsResolver.CacheTTL)
1267-
} else {
1268-
config.Valid = "30s"
12691265
}
12701266

12711267
if dnsResolver.DisableIPv6 != nil {
12721268
config.DisableIPv6 = *dnsResolver.DisableIPv6
1273-
} else {
1274-
config.DisableIPv6 = true
12751269
}
12761270

12771271
return config

internal/controller/state/dataplane/configuration_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5173,13 +5173,13 @@ func TestBuildDNSResolverConfig(t *testing.T) {
51735173
Addresses: addr,
51745174
Timeout: helpers.GetPointer(ngfAPIv1alpha1.Duration("10s")),
51755175
CacheTTL: helpers.GetPointer(ngfAPIv1alpha1.Duration("60s")),
5176-
DisableIPv6: helpers.GetPointer(false),
5176+
DisableIPv6: helpers.GetPointer(true),
51775177
},
51785178
expected: &DNSResolverConfig{
51795179
Addresses: []string{"8.8.8.8", "dns.google"},
51805180
Timeout: "10s",
51815181
Valid: "60s",
5182-
DisableIPv6: false,
5182+
DisableIPv6: true,
51835183
},
51845184
},
51855185
{
@@ -5189,9 +5189,7 @@ func TestBuildDNSResolverConfig(t *testing.T) {
51895189
},
51905190
expected: &DNSResolverConfig{
51915191
Addresses: []string{"8.8.8.8", "dns.google"},
5192-
Timeout: "30s",
5193-
Valid: "30s",
5194-
DisableIPv6: true,
5192+
DisableIPv6: false,
51955193
},
51965194
},
51975195
}

0 commit comments

Comments
 (0)