Skip to content

Commit

Permalink
move and simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiden Carpenter committed Dec 11, 2023
1 parent 00a1942 commit af50d26
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/pkg/manifest/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2227,11 +2227,6 @@ func validateAndPopulateNLBListenerPorts(listener NetworkLoadBalancerListener, p
return err
}

// Handle termination of TLS protocol
if strings.ToUpper(aws.StringValue(nlbProtocol)) == TLS {
nlbProtocol = aws.String(TCP)
}

port, err := strconv.ParseUint(aws.StringValue(nlbReceiverPort), 10, 16)
if err != nil {
return err
Expand All @@ -2248,6 +2243,11 @@ func validateAndPopulateNLBListenerPorts(listener NetworkLoadBalancerListener, p
targetProtocol = strings.ToUpper(aws.StringValue(nlbProtocol))
}

// Handle TLS termination of container exposed port protocol
if targetProtocol == TLS {
targetProtocol = TCP
}

// Prefer `nlb.target_container`, then existing exposed port mapping, then fallback on name of main container
targetContainer := mainContainerName
if existingContainerNameAndProtocol, ok := portExposedTo[targetPort]; ok {
Expand Down

0 comments on commit af50d26

Please sign in to comment.