-
Notifications
You must be signed in to change notification settings - Fork 705
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
Changes from all 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 55e0c06
chore: bump go to 1.24 (#5287)
zirain e855fea
build(deps): bump sigs.k8s.io/kind from 0.26.0 to 0.27.0 in /tools/sr…
dependabot[bot] 1eb360b
build(deps): bump helm.sh/helm/v3 from 3.17.0 to 3.17.1 (#5291)
dependabot[bot] 13a88ad
build(deps): bump the golang-org group across 2 directories with 1 up…
dependabot[bot] c27c8f1
build(deps): bump github.com/golangci/golangci-lint from 1.63.4 to 1.…
dependabot[bot] d5b97b6
Add test case
tobrien-nydig f97e035
Add test case
tobrien-nydig ee7464d
one more test
tobrien-nydig 682d7d4
one more test
tobrien-nydig 53d33ef
remove
tobrien-nydig 4a6406a
Found the bug for real
tobrien-nydig e3a2b2d
Focus on gatewayapi
tobrien-nydig 17362d6
cleanup
tobrien-nydig 8c639a8
cleanup
tobrien-nydig 3933d78
build(deps): bump github.com/evanphx/json-patch/v5 from 5.9.0 to 5.9.…
dependabot[bot] 83ec08e
api: BackendTrafficPolicy DNSLookupFamily (#5249)
guydc 3c37e69
clean up logic on if
tobrien-nydig e0f1dca
Update logic and add udp tests
tobrien-nydig 4d3612f
fix udp tests
tobrien-nydig d668694
chore: ignore `sched.co` (#5305)
zirain 10602e9
newline
tobrien-nydig 25986ef
Merge branch 'main' into zero-weight-fix
tobrien-nydig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
internal/gatewayapi/testdata/tcproute-rule-with-multiple-backends-and-zero-weights.in.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| gateways: | ||
| - apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| namespace: envoy-gateway | ||
| name: gateway-1 | ||
| spec: | ||
| gatewayClassName: envoy-gateway-class | ||
| listeners: | ||
| - name: tcp | ||
| protocol: TCP | ||
| port: 90 | ||
| allowedRoutes: | ||
| namespaces: | ||
| from: All | ||
| tcpRoutes: | ||
| - apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
| kind: TCPRoute | ||
| metadata: | ||
| namespace: default | ||
| name: tcproute-1 | ||
| spec: | ||
| parentRefs: | ||
| - namespace: envoy-gateway | ||
| name: gateway-1 | ||
| rules: | ||
| - backendRefs: | ||
| - name: service-1 | ||
| port: 8080 | ||
| weight: 1 | ||
| - name: service-2 | ||
| port: 8080 | ||
| weight: 2 | ||
| - name: service-3 | ||
| port: 8080 | ||
| weight: 3 | ||
| - name: service-4 | ||
| port: 8080 | ||
| weight: 0 |
134 changes: 134 additions & 0 deletions
134
internal/gatewayapi/testdata/tcproute-rule-with-multiple-backends-and-zero-weights.out.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| gateways: | ||
| - apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: gateway-1 | ||
| namespace: envoy-gateway | ||
| spec: | ||
| gatewayClassName: envoy-gateway-class | ||
| listeners: | ||
| - allowedRoutes: | ||
| namespaces: | ||
| from: All | ||
| name: tcp | ||
| port: 90 | ||
| protocol: TCP | ||
| status: | ||
| listeners: | ||
| - attachedRoutes: 1 | ||
| conditions: | ||
| - lastTransitionTime: null | ||
| message: Sending translated listener configuration to the data plane | ||
| reason: Programmed | ||
| status: "True" | ||
| type: Programmed | ||
| - lastTransitionTime: null | ||
| message: Listener has been successfully translated | ||
| reason: Accepted | ||
| status: "True" | ||
| type: Accepted | ||
| - lastTransitionTime: null | ||
| message: Listener references have been resolved | ||
| reason: ResolvedRefs | ||
| status: "True" | ||
| type: ResolvedRefs | ||
| name: tcp | ||
| supportedKinds: | ||
| - group: gateway.networking.k8s.io | ||
| kind: TCPRoute | ||
| infraIR: | ||
| envoy-gateway/gateway-1: | ||
| proxy: | ||
| listeners: | ||
| - address: null | ||
| name: envoy-gateway/gateway-1/tcp | ||
| ports: | ||
| - containerPort: 10090 | ||
| name: tcp-90 | ||
| protocol: TCP | ||
| servicePort: 90 | ||
| metadata: | ||
| labels: | ||
| gateway.envoyproxy.io/owning-gateway-name: gateway-1 | ||
| gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway | ||
| name: envoy-gateway/gateway-1 | ||
| tcpRoutes: | ||
| - apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
| kind: TCPRoute | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: tcproute-1 | ||
| namespace: default | ||
| spec: | ||
| parentRefs: | ||
| - name: gateway-1 | ||
| namespace: envoy-gateway | ||
| rules: | ||
| - backendRefs: | ||
| - name: service-1 | ||
| port: 8080 | ||
| weight: 1 | ||
| - name: service-2 | ||
| port: 8080 | ||
| weight: 2 | ||
| - name: service-3 | ||
| port: 8080 | ||
| weight: 3 | ||
| - name: service-4 | ||
| port: 8080 | ||
| weight: 0 | ||
| status: | ||
| parents: | ||
| - conditions: | ||
| - lastTransitionTime: null | ||
| message: Route is accepted | ||
| reason: Accepted | ||
| status: "True" | ||
| type: Accepted | ||
| - lastTransitionTime: null | ||
| message: Resolved all the Object references for the Route | ||
| reason: ResolvedRefs | ||
| status: "True" | ||
| type: ResolvedRefs | ||
| controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
| parentRef: | ||
| name: gateway-1 | ||
| namespace: envoy-gateway | ||
| xdsIR: | ||
| envoy-gateway/gateway-1: | ||
| accessLog: | ||
| text: | ||
| - path: /dev/stdout | ||
| readyListener: | ||
| address: 0.0.0.0 | ||
| ipFamily: IPv4 | ||
| path: /ready | ||
| port: 19003 | ||
| tcp: | ||
| - address: 0.0.0.0 | ||
| name: envoy-gateway/gateway-1/tcp | ||
| port: 10090 | ||
| routes: | ||
| - destination: | ||
| name: tcproute/default/tcproute-1/rule/-1 | ||
| settings: | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 8080 | ||
| protocol: TCP | ||
| weight: 1 | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 8080 | ||
| protocol: TCP | ||
| weight: 2 | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 8080 | ||
| protocol: TCP | ||
| weight: 3 | ||
| name: tcproute/default/tcproute-1 |
39 changes: 39 additions & 0 deletions
39
internal/gatewayapi/testdata/udproute-rule-with-multiple-backends-and-zero-weights.in.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| gateways: | ||
| - apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| namespace: envoy-gateway | ||
| name: gateway-1 | ||
| spec: | ||
| gatewayClassName: envoy-gateway-class | ||
| listeners: | ||
| - name: udp | ||
| protocol: UDP | ||
| port: 90 | ||
| allowedRoutes: | ||
| namespaces: | ||
| from: All | ||
| udpRoutes: | ||
| - apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
| kind: UDPRoute | ||
| metadata: | ||
| namespace: default | ||
| name: udproute-1 | ||
| spec: | ||
| parentRefs: | ||
| - namespace: envoy-gateway | ||
| name: gateway-1 | ||
| rules: | ||
| - backendRefs: | ||
| - name: service-1 | ||
| port: 8162 | ||
| weight: 1 | ||
| - name: service-2 | ||
| port: 8162 | ||
| weight: 2 | ||
| - name: service-3 | ||
| port: 8162 | ||
| weight: 3 | ||
| - name: service-4 | ||
| port: 8162 | ||
| weight: 0 |
134 changes: 134 additions & 0 deletions
134
internal/gatewayapi/testdata/udproute-rule-with-multiple-backends-and-zero-weights.out.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| gateways: | ||
| - apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: gateway-1 | ||
| namespace: envoy-gateway | ||
| spec: | ||
| gatewayClassName: envoy-gateway-class | ||
| listeners: | ||
| - allowedRoutes: | ||
| namespaces: | ||
| from: All | ||
| name: udp | ||
| port: 90 | ||
| protocol: UDP | ||
| status: | ||
| listeners: | ||
| - attachedRoutes: 1 | ||
| conditions: | ||
| - lastTransitionTime: null | ||
| message: Sending translated listener configuration to the data plane | ||
| reason: Programmed | ||
| status: "True" | ||
| type: Programmed | ||
| - lastTransitionTime: null | ||
| message: Listener has been successfully translated | ||
| reason: Accepted | ||
| status: "True" | ||
| type: Accepted | ||
| - lastTransitionTime: null | ||
| message: Listener references have been resolved | ||
| reason: ResolvedRefs | ||
| status: "True" | ||
| type: ResolvedRefs | ||
| name: udp | ||
| supportedKinds: | ||
| - group: gateway.networking.k8s.io | ||
| kind: UDPRoute | ||
| infraIR: | ||
| envoy-gateway/gateway-1: | ||
| proxy: | ||
| listeners: | ||
| - address: null | ||
| name: envoy-gateway/gateway-1/udp | ||
| ports: | ||
| - containerPort: 10090 | ||
| name: udp-90 | ||
| protocol: UDP | ||
| servicePort: 90 | ||
| metadata: | ||
| labels: | ||
| gateway.envoyproxy.io/owning-gateway-name: gateway-1 | ||
| gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway | ||
| name: envoy-gateway/gateway-1 | ||
| udpRoutes: | ||
| - apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
| kind: UDPRoute | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: udproute-1 | ||
| namespace: default | ||
| spec: | ||
| parentRefs: | ||
| - name: gateway-1 | ||
| namespace: envoy-gateway | ||
| rules: | ||
| - backendRefs: | ||
| - name: service-1 | ||
| port: 8162 | ||
| weight: 1 | ||
| - name: service-2 | ||
| port: 8162 | ||
| weight: 2 | ||
| - name: service-3 | ||
| port: 8162 | ||
| weight: 3 | ||
| - name: service-4 | ||
| port: 8162 | ||
| weight: 0 | ||
| status: | ||
| parents: | ||
| - conditions: | ||
| - lastTransitionTime: null | ||
| message: Route is accepted | ||
| reason: Accepted | ||
| status: "True" | ||
| type: Accepted | ||
| - lastTransitionTime: null | ||
| message: Resolved all the Object references for the Route | ||
| reason: ResolvedRefs | ||
| status: "True" | ||
| type: ResolvedRefs | ||
| controllerName: gateway.envoyproxy.io/gatewayclass-controller | ||
| parentRef: | ||
| name: gateway-1 | ||
| namespace: envoy-gateway | ||
| xdsIR: | ||
| envoy-gateway/gateway-1: | ||
| accessLog: | ||
| text: | ||
| - path: /dev/stdout | ||
| readyListener: | ||
| address: 0.0.0.0 | ||
| ipFamily: IPv4 | ||
| path: /ready | ||
| port: 19003 | ||
| udp: | ||
| - address: 0.0.0.0 | ||
| name: envoy-gateway/gateway-1/udp | ||
| port: 10090 | ||
| route: | ||
| destination: | ||
| name: udproute/default/udproute-1/rule/-1 | ||
| settings: | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 8162 | ||
| protocol: UDP | ||
| weight: 1 | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 8162 | ||
| protocol: UDP | ||
| weight: 2 | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 8162 | ||
| protocol: UDP | ||
| weight: 3 | ||
| name: udproute/default/udproute-1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.