CNF-25075: Deduplicate TLS profile resolution logic#76
Conversation
|
@sebrandon1: This pull request references CNF-25075 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
… profile resolution Replace three repeated if-blocks in getIngressControllerTLS and extractAPIServerTLS with a single map-lookup helper, matching the pattern already used by getKubeletTLS. Also fix a subtle fall-through in extractAPIServerTLS where Custom profile values could be overwritten by a subsequent predefined profile match.
ed382b9 to
9147386
Compare
|
@sebrandon1: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
resolvePredefinedProfile()helper that uses a singleconfigv1.TLSProfilesmap lookup to resolve Old/Intermediate/Modern profile types into ciphers and minTLSVersiongetIngressControllerTLS()andextractAPIServerTLS()with calls to the new helpergetKubeletTLS()to use the same helper for consistency (it already used a map lookup but inline)extractAPIServerTLS()where Custom profile values could theoretically be overwritten by a subsequent predefined profile match — added early returnNet: -27/+18 lines in
internal/k8s/tls.go.Jira
CNF-25075 (under CNF-23701 tls-scanner tuning epic)