Skip to content

fix(pkg/cincinnati): log the correct root CA pool size#1413

Open
vprashar2929 wants to merge 1 commit into
openshift:mainfrom
vprashar2929:fix-cincinnati-rootcas-log
Open

fix(pkg/cincinnati): log the correct root CA pool size#1413
vprashar2929 wants to merge 1 commit into
openshift:mainfrom
vprashar2929:fix-cincinnati-rootcas-log

Conversation

@vprashar2929

@vprashar2929 vprashar2929 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

GetUpdates checked TLSClientConfig.ClientCAs to decide whether to log the root CA subject count, but the client transport only ever populates RootCAs (ClientCAs is a server-side field, never set for this outbound client). The nil check was therefore always true: the log always reported "0 root CA subjects" and the branch reporting the real count was dead. Check RootCAs instead, which also correctly guards the RootCAs.Subjects() dereference in the else branch.

Summary by CodeRabbit

  • Bug Fixes
    • Improved TLS certificate handling when fetching updates.
    • Fixed an issue where the app could inspect the wrong certificate pool, which affected root CA logging and could cause errors when no root CA list was set.

GetUpdates checked TLSClientConfig.ClientCAs to decide whether to log
the root CA subject count, but the client transport only ever populates RootCAs (ClientCAs is a server-side field, never set for this outbound client). The nil check was therefore always true: the log always reported "0 root CA subjects" and the branch reporting the real count was dead. Check RootCAs instead, which also correctly guards the RootCAs.Subjects() dereference in the else branch.

Signed-off-by: vprashar2929 <vibhu.sharma2929@gmail.com>
@openshift-ci

openshift-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vprashar2929
Once this PR has been reviewed and has the lgtm label, please assign davidhurta 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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 25, 2026
@openshift-ci

openshift-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Hi @vprashar2929. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 90f63dc0-7042-4c54-88b7-27c6c8221f1a

📥 Commits

Reviewing files that changed from the base of the PR and between 26871b1 and adfa00a.

📒 Files selected for processing (1)
  • pkg/cincinnati/cincinnati.go

Walkthrough

Client.GetUpdates now checks TLSClientConfig.RootCAs before logging and using the root CA subject list.

Changes

TLS root CA nil-check fix

Layer / File(s) Summary
Root CA nil-check
pkg/cincinnati/cincinnati.go
GetUpdates now tests TLSClientConfig.RootCAs == nil in the root CA branch before reading Subjects() and logging the subject count.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing root CA pool size logging in pkg/cincinnati.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Only pkg/cincinnati/cincinnati.go changed; it’s non-test code and pkg/cincinnati has no Ginkgo titles, so no unstable test names were introduced.
Test Structure And Quality ✅ Passed No Ginkgo tests were changed or added here; pkg/cincinnati uses standard Go tests only, so the test-quality checklist is not applicable.
Microshift Test Compatibility ✅ Passed PR only changes pkg/cincinnati/cincinnati.go in GetUpdates; no new Ginkgo test declarations or OpenShift API/resource uses were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only touches pkg/cincinnati/cincinnati.go; no new or modified Ginkgo e2e tests or SNO-sensitive cluster assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only changes TLS root CA logging in pkg/cincinnati; no deployment manifests, controllers, or scheduling constraints were added.
Ote Binary Stdout Contract ✅ Passed PASS: The PR only changes a nil check in Client.GetUpdates; no main/init/TestMain/suite setup or stdout writes were added in the touched code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR only changes pkg/cincinnati/cincinnati.go; no new Ginkgo e2e tests or network-facing test code were added.
No-Weak-Crypto ✅ Passed Touched code only changes a RootCAs nil check for logging; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or secret comparisons found.
Container-Privileges ✅ Passed The change is confined to pkg/cincinnati/cincinnati.go and only adjusts TLS CA logging; no container/K8s manifests or privilege settings are touched.
No-Sensitive-Data-In-Logs ✅ Passed The PR only changes a nil check in an existing log branch; it does not add or expand logging of secrets, PII, or internal data.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant