Skip to content

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

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
vprashar2929:fix-cincinnati-rootcas-log
Jul 30, 2026
Merged

NO-JIRA: fix(pkg/cincinnati): log the correct root CA pool size#1413
openshift-merge-bot[bot] merged 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 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

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.
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.
Title check ✅ Passed The title clearly matches the main change: fixing root CA pool size logging in pkg/cincinnati.
✨ 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.

@vprashar2929

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@openshift-ci

openshift-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@vprashar2929: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

@DavidHurta

Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 28, 2026

@DavidHurta DavidHurta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thank you for the contribution!

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2026
@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DavidHurta, vprashar2929

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2026
@vprashar2929

Copy link
Copy Markdown
Contributor Author

Nice catch! Thank you for the contribution!

Happy to contribute! 😊

@DavidHurta

Copy link
Copy Markdown
Contributor

/retitle NO-JIRA: fix(pkg/cincinnati): log the correct root CA pool size

@openshift-ci openshift-ci Bot changed the title fix(pkg/cincinnati): log the correct root CA pool size NO-JIRA: fix(pkg/cincinnati): log the correct root CA pool size Jul 29, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@vprashar2929: This pull request explicitly references no jira issue.

Details

In response to this:

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.

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.

@DavidHurta

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-hypershift-conformance

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@DavidHurta: Overrode contexts on behalf of DavidHurta: ci/prow/e2e-hypershift-conformance

Details

In response to this:

/override ci/prow/e2e-hypershift-conformance

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.

@DavidHurta

Copy link
Copy Markdown
Contributor

/verified by @DavidHurta

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@DavidHurta: This PR has been marked as verified by @DavidHurta.

Details

In response to this:

/verified by @DavidHurta

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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD bc2e913 and 2 for PR HEAD adfa00a in total

@vprashar2929

Copy link
Copy Markdown
Contributor Author

/test e2e-agnostic-ovn-techpreview-serial-2of3

1 similar comment
@vprashar2929

Copy link
Copy Markdown
Contributor Author

/test e2e-agnostic-ovn-techpreview-serial-2of3

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 42ff52c into openshift:main Jul 30, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants