-
Notifications
You must be signed in to change notification settings - Fork 428
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
fix: account for tls termination in exposed port validation #5549
fix: account for tls termination in exposed port validation #5549
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## mainline #5549 +/- ##
============================================
- Coverage 70.04% 70.03% -0.01%
============================================
Files 302 302
Lines 46331 46355 +24
Branches 309 309
============================================
+ Hits 32453 32466 +13
- Misses 12300 12309 +9
- Partials 1578 1580 +2 ☔ View full report in Codecov by Sentry. |
🍕 Here are the new binary sizes!
|
targetProtocol = strings.ToUpper(aws.StringValue(nlbProtocol)) | ||
} | ||
|
||
// Handle TLS termination of container exposed port protocol | ||
if targetProtocol == TLS { | ||
targetProtocol = TCP | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really am not a fan of nested if-block, but I think it's more obvious this way that we set the target protocol to TCP if the listener protocol is TLS, not necessarily if the target protocol is "tls". Imagine if we expand target_port
to accept a string of form 443/tls
(for example to let people configure e2e encryption), then this code might become slightly confusing to refactor.
targetProtocol = strings.ToUpper(aws.StringValue(nlbProtocol)) | |
} | |
// Handle TLS termination of container exposed port protocol | |
if targetProtocol == TLS { | |
targetProtocol = TCP | |
} | |
if strings.EqualFold(aws.StringValue(nlbProtocol), "tls") { | |
targetProtocol = TCP | |
} else { | |
targetProtocol = strings.ToUpper(aws.StringValue(nlbProtocol)) | |
} |
Addresses #5536
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.