-
Notifications
You must be signed in to change notification settings - Fork 356
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: btlsp section name doesn't support port name #4784
base: main
Are you sure you want to change the base?
Conversation
153fd00
to
454d292
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4784 +/- ##
==========================================
- Coverage 65.59% 65.59% -0.01%
==========================================
Files 211 211
Lines 32001 32024 +23
==========================================
+ Hits 20992 21005 +13
- Misses 9767 9775 +8
- Partials 1242 1244 +2 ☔ View full report in Codecov by Sentry. |
454d292
to
97289e5
Compare
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
19a4814
to
1536c2a
Compare
target := getTargetBackendReference(backendRef) | ||
for _, policy := range policies { | ||
if backendTLSTargetMatched(*policy, target, backendNamespace) { | ||
return policy | ||
} | ||
} | ||
|
||
// SectionName can be port name for Kubernetes Service | ||
target = getTargetBackendReferenceWithPortName(backendRef, backendNamespace, resources) |
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.
why do we need another new function
isnt there logic already for this in
// if section name is not set, then it targets the entire backend |
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.
This function uses port name instead of port number as sectionName to match policy.
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.
lets support port number - section name matching for Backend and only port name - section name matching for Service, this ensures the user config can be safely migrated and tested in other controllers
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Fixes #4769
This PR allows using port name as the
sectionName
for the targetRefs of theBackendTLSPolicy
.The support for port number has been retained because:
Backend
API, which doesn't have a name for its portRelease Notes: Yes