Skip to content

Commit fb6c956

Browse files
committed
Pass UDP flag to upstream zone
1 parent 1339451 commit fb6c956

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

serverscom/loadbalancers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ func (l *loadBalancers) buildZones(service *v1.Service, nodes []*v1.Node) ([]cli
237237
upstreamZoneInput := cli.L4UpstreamZoneInput{}
238238
upstreamZoneInput.ID = id
239239

240+
if port.Protocol == "UDP" {
241+
upstreamZoneInput.UDP = true
242+
}
243+
240244
for _, node := range nodes {
241245
for _, address := range node.Status.Addresses {
242246
if address.Type != v1.NodeInternalIP {

serverscom/loadbalancers_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func TestLoadBalancers_EnsureLoadBalancer(t *testing.T) {
232232
{
233233
ID: "k8s-nodes-11211-udp",
234234
Method: nil,
235-
UDP: false,
235+
UDP: true,
236236
HCInterval: nil,
237237
HCJitter: nil,
238238
Upstreams: []cli.L4UpstreamInput{
@@ -339,7 +339,7 @@ func TestLoadBalancers_EnsureLoadBalancerWithCreate(t *testing.T) {
339339
{
340340
ID: "k8s-nodes-11211-udp",
341341
Method: nil,
342-
UDP: false,
342+
UDP: true,
343343
HCInterval: nil,
344344
HCJitter: nil,
345345
Upstreams: []cli.L4UpstreamInput{
@@ -464,7 +464,7 @@ func TestLoadBalancers_UpdateLoadBalancer(t *testing.T) {
464464
{
465465
ID: "k8s-nodes-11211-udp",
466466
Method: nil,
467-
UDP: false,
467+
UDP: true,
468468
HCInterval: nil,
469469
HCJitter: nil,
470470
Upstreams: []cli.L4UpstreamInput{

0 commit comments

Comments
 (0)