Skip to content

fix: Allow weights to be zero on endpoints #5278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d40f5d3
fix: Allow weights to be zero on endpoints
tobrien-nydig Feb 14, 2025
55e0c06
chore: bump go to 1.24 (#5287)
zirain Feb 18, 2025
e855fea
build(deps): bump sigs.k8s.io/kind from 0.26.0 to 0.27.0 in /tools/sr…
dependabot[bot] Feb 18, 2025
1eb360b
build(deps): bump helm.sh/helm/v3 from 3.17.0 to 3.17.1 (#5291)
dependabot[bot] Feb 18, 2025
13a88ad
build(deps): bump the golang-org group across 2 directories with 1 up…
dependabot[bot] Feb 18, 2025
c27c8f1
build(deps): bump github.com/golangci/golangci-lint from 1.63.4 to 1.…
dependabot[bot] Feb 18, 2025
d5b97b6
Add test case
tobrien-nydig Feb 18, 2025
f97e035
Add test case
tobrien-nydig Feb 18, 2025
ee7464d
one more test
tobrien-nydig Feb 18, 2025
682d7d4
one more test
tobrien-nydig Feb 18, 2025
53d33ef
remove
tobrien-nydig Feb 18, 2025
4a6406a
Found the bug for real
tobrien-nydig Feb 18, 2025
e3a2b2d
Focus on gatewayapi
tobrien-nydig Feb 19, 2025
17362d6
cleanup
tobrien-nydig Feb 19, 2025
8c639a8
cleanup
tobrien-nydig Feb 19, 2025
3933d78
build(deps): bump github.com/evanphx/json-patch/v5 from 5.9.0 to 5.9.…
dependabot[bot] Feb 18, 2025
83ec08e
api: BackendTrafficPolicy DNSLookupFamily (#5249)
guydc Feb 19, 2025
3c37e69
clean up logic on if
tobrien-nydig Feb 19, 2025
e0f1dca
Update logic and add udp tests
tobrien-nydig Feb 19, 2025
4d3612f
fix udp tests
tobrien-nydig Feb 19, 2025
d668694
chore: ignore `sched.co` (#5305)
zirain Feb 19, 2025
10602e9
newline
tobrien-nydig Feb 19, 2025
25986ef
Merge branch 'main' into zero-weight-fix
tobrien-nydig Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api/v1alpha1/dns_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ package v1alpha1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// DNSLookupFamily defines the behavior of Envoy when resolving DNS for hostnames
// +enum
// +kubebuilder:validation:Enum=IPv4;IPv6;IPv4Preferred;IPv6Preferred;IPv4AndIPv6
type DNSLookupFamily string

const (
// IPv4DNSLookupFamily means the DNS resolver will first perform a lookup for addresses in the IPv4 family.
IPv4DNSLookupFamily DNSLookupFamily = "IPv4"
// IPv6DNSLookupFamily means the DNS resolver will first perform a lookup for addresses in the IPv6 family.
IPv6DNSLookupFamily DNSLookupFamily = "IPv6"
// IPv4PreferredDNSLookupFamily means the DNS resolver will first perform a lookup for addresses in the IPv4 family and fallback
// to a lookup for addresses in the IPv6 family.
IPv4PreferredDNSLookupFamily DNSLookupFamily = "IPv4Preferred"
// IPv6PreferredDNSLookupFamily means the DNS resolver will first perform a lookup for addresses in the IPv6 family and fallback
// to a lookup for addresses in the IPv4 family.
IPv6PreferredDNSLookupFamily DNSLookupFamily = "IPv6Preferred"
// IPv4AndIPv6DNSLookupFamily mean the DNS resolver will perform a lookup for both IPv4 and IPv6 families, and return all resolved
// addresses. When this is used, Happy Eyeballs will be enabled for upstream connections.
IPv4AndIPv6DNSLookupFamily DNSLookupFamily = "IPv4AndIPv6"
)

type DNS struct {
// DNSRefreshRate specifies the rate at which DNS records should be refreshed.
// Defaults to 30 seconds.
Expand All @@ -15,4 +36,9 @@ type DNS struct {
// If the value is set to true, the DNS refresh rate will be set to the resource record’s TTL.
// Defaults to true.
RespectDNSTTL *bool `json:"respectDnsTtl,omitempty"`
// LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
// value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
// +optional
// +notImplementedHide
LookupFamily *DNSLookupFamily `json:"lookupFamily,omitempty"`
}
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10767,6 +10767,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down Expand Up @@ -11754,6 +11765,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down Expand Up @@ -12834,6 +12856,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down Expand Up @@ -13829,6 +13862,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down Expand Up @@ -1612,6 +1623,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down Expand Up @@ -2632,6 +2654,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down Expand Up @@ -3663,6 +3696,17 @@ spec:
DNSRefreshRate specifies the rate at which DNS records should be refreshed.
Defaults to 30 seconds.
type: string
lookupFamily:
description: |-
LookupFamily determines how Envoy would resolve DNS for. If set, this configuration overrides other default
value that Envoy Gateway configures based on attributes of the backends, such Service resource IPFamilies.
enum:
- IPv4
- IPv6
- IPv4Preferred
- IPv6Preferred
- IPv4AndIPv6
type: string
respectDnsTtl:
description: |-
RespectDNSTTL indicates whether the DNS Time-To-Live (TTL) should be respected.
Expand Down
2 changes: 1 addition & 1 deletion examples/envoy-als/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.6 AS builder
FROM golang:1.24.0 AS builder

ARG GO_LDFLAGS=""

Expand Down
2 changes: 1 addition & 1 deletion examples/envoy-als/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/envoyproxy/gateway-envoy-als

go 1.23.6
go 1.24.0

require (
github.com/envoyproxy/go-control-plane v0.13.1
Expand Down
2 changes: 1 addition & 1 deletion examples/envoy-ext-auth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.6 AS builder
FROM golang:1.24.0 AS builder

ARG GO_LDFLAGS=""

Expand Down
2 changes: 1 addition & 1 deletion examples/envoy-ext-auth/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/envoyproxy/gateway-grcp-ext-auth

go 1.23.6
go 1.24.0

require (
github.com/envoyproxy/go-control-plane v0.13.1
Expand Down
6 changes: 3 additions & 3 deletions examples/extension-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/exampleorg/envoygateway-extension

go 1.23.6
go 1.24.0

require (
github.com/envoyproxy/gateway v1.0.2
Expand Down Expand Up @@ -32,9 +32,9 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/text v0.22.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions examples/extension-server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -110,8 +110,8 @@ golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
Expand Down
2 changes: 1 addition & 1 deletion examples/extension-server/tools/src/controller-gen/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module local

go 1.23.6
go 1.24.0

require sigs.k8s.io/controller-tools v0.17.1

Expand Down
2 changes: 1 addition & 1 deletion examples/grpc-ext-proc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.6 AS builder
FROM golang:1.24.0 AS builder

ARG GO_LDFLAGS=""

Expand Down
2 changes: 1 addition & 1 deletion examples/grpc-ext-proc/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/envoyproxy/gateway-grpc-ext-proc

go 1.23.6
go 1.24.0

require (
github.com/envoyproxy/go-control-plane v0.13.1
Expand Down
2 changes: 1 addition & 1 deletion examples/preserve-case-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.6 AS builder
FROM golang:1.24.0 AS builder

ARG GO_LDFLAGS=""

Expand Down
2 changes: 1 addition & 1 deletion examples/preserve-case-backend/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/envoyproxy/gateway-preserve-case-backend

go 1.23.6
go 1.24.0

require github.com/valyala/fasthttp v1.51.0

Expand Down
2 changes: 1 addition & 1 deletion examples/static-file-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.6 AS builder
FROM golang:1.24.0 AS builder

ARG GO_LDFLAGS=""

Expand Down
2 changes: 1 addition & 1 deletion examples/static-file-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/envoyproxy/static-file-server

go 1.23.6
go 1.24.0
Loading