Skip to content

CNF-25075: Deduplicate TLS profile resolution logic#76

Open
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:dedup-tls-profile-resolve
Open

CNF-25075: Deduplicate TLS profile resolution logic#76
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:dedup-tls-profile-resolve

Conversation

@sebrandon1

Copy link
Copy Markdown
Member

Summary

  • Extract resolvePredefinedProfile() helper that uses a single configv1.TLSProfiles map lookup to resolve Old/Intermediate/Modern profile types into ciphers and minTLSVersion
  • Replace three repeated if-blocks in getIngressControllerTLS() and extractAPIServerTLS() with calls to the new helper
  • Update getKubeletTLS() to use the same helper for consistency (it already used a map lookup but inline)
  • Fix subtle fall-through in extractAPIServerTLS() where Custom profile values could theoretically be overwritten by a subsequent predefined profile match — added early return

Net: -27/+18 lines in internal/k8s/tls.go.

Jira

CNF-25075 (under CNF-23701 tls-scanner tuning epic)

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 15, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 15, 2026

Copy link
Copy Markdown

@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.

Details

In response to this:

Summary

  • Extract resolvePredefinedProfile() helper that uses a single configv1.TLSProfiles map lookup to resolve Old/Intermediate/Modern profile types into ciphers and minTLSVersion
  • Replace three repeated if-blocks in getIngressControllerTLS() and extractAPIServerTLS() with calls to the new helper
  • Update getKubeletTLS() to use the same helper for consistency (it already used a map lookup but inline)
  • Fix subtle fall-through in extractAPIServerTLS() where Custom profile values could theoretically be overwritten by a subsequent predefined profile match — added early return

Net: -27/+18 lines in internal/k8s/tls.go.

Jira

CNF-25075 (under CNF-23701 tls-scanner tuning epic)

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.

@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign rhmdnd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

… 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.
@sebrandon1 sebrandon1 force-pushed the dedup-tls-profile-resolve branch from ed382b9 to 9147386 Compare June 18, 2026 17:32
@openshift-ci

openshift-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

@sebrandon1: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants