Skip to content

Commit a6a7230

Browse files
lydazac-nixon
authored andcommitted
Attempt to address remaining errors
1 parent 0b905c7 commit a6a7230

File tree

2 files changed

+202
-172
lines changed

2 files changed

+202
-172
lines changed

pkg/service/model_build_target_group.go

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ func (t *defaultModelBuildTask) buildTargetGroupBindingNetworking(_ context.Cont
504504
Protocol: &protocolTCP,
505505
Port: &tgPort,
506506
})
507+
case corev1.Protocol("TCP_UDP"):
508+
fallthrough
507509
case corev1.ProtocolUDP:
508510
ports = append(ports, elbv2api.NetworkingPort{
509511
Protocol: &protocolUDP,
@@ -581,15 +583,43 @@ func (t *defaultModelBuildTask) buildTargetGroupBindingNetworkingLegacy(ctx cont
581583
loadBalancerSubnetCIDRs := t.getLoadBalancerSubnetsSourceRanges(targetGroupIPAddressType)
582584
trafficSource := loadBalancerSubnetCIDRs
583585
defaultRangeUsed := false
586+
<<<<<<< HEAD
587+
=======
588+
var trafficPorts []elbv2api.NetworkingPort
589+
>>>>>>> 08431ef8 (Attempt to address remaining errors)
584590
if networkingProtocol == elbv2api.NetworkingProtocolUDP || t.preserveClientIP {
585591
trafficSource = t.getLoadBalancerSourceRanges(ctx)
586592
if len(trafficSource) == 0 {
587-
trafficSource, err = t.getDefaultIPSourceRanges(ctx, targetGroupIPAddressType, port.Protocol, scheme)
593+
trafficSource, err = t.getDefaultIPSourceRanges(ctx, targetGroupIPAddressType, tgProtocol, scheme)
588594
if err != nil {
589595
return nil, err
590596
}
591597
defaultRangeUsed = true
592598
}
599+
<<<<<<< HEAD
600+
=======
601+
}
602+
if networkingProtocol == elbv2api.NetworkingProtocolTCP_UDP {
603+
tcpProtocol := elbv2api.NetworkingProtocolTCP
604+
udpProtocol := elbv2api.NetworkingProtocolUDP
605+
trafficPorts = []elbv2api.NetworkingPort{
606+
{
607+
Port: &tgPort,
608+
Protocol: &tcpProtocol,
609+
},
610+
{
611+
Port: &tgPort,
612+
Protocol: &udpProtocol,
613+
},
614+
}
615+
} else {
616+
trafficPorts = []elbv2api.NetworkingPort{
617+
{
618+
Port: &tgPort,
619+
Protocol: &networkingProtocol,
620+
},
621+
}
622+
>>>>>>> 08431ef8 (Attempt to address remaining errors)
593623
}
594624
tgbNetworking := &elbv2model.TargetGroupBindingNetworking{
595625
Ingress: []elbv2model.NetworkingIngressRule{
@@ -629,7 +659,7 @@ func (t *defaultModelBuildTask) getDefaultIPSourceRanges(ctx context.Context, ta
629659
if targetGroupIPAddressType == elbv2model.TargetGroupIPAddressTypeIPv6 {
630660
defaultSourceRanges = t.defaultIPv6SourceRanges
631661
}
632-
if (protocol == corev1.ProtocolUDP || t.preserveClientIP) && scheme == elbv2model.LoadBalancerSchemeInternal {
662+
if (protocol == corev1.Protocol("TCP_UDP") || protocol == corev1.ProtocolUDP || t.preserveClientIP) && scheme == elbv2model.LoadBalancerSchemeInternal {
633663
vpcInfo, err := t.vpcInfoProvider.FetchVPCInfo(ctx, t.vpcID, networking.FetchVPCInfoWithoutCache())
634664
if err != nil {
635665
return nil, err

0 commit comments

Comments
 (0)