Skip to content

Stop logging kubeconfigs in ApplyOperation and ProcessOAM - #90

Open
Himanshu2649 wants to merge 1 commit into
meshery-extensions:masterfrom
Himanshu2649:fix/redact-kubeconfig-logs
Open

Himanshu2649 wants to merge 1 commit into
meshery-extensions:masterfrom
Himanshu2649:fix/redact-kubeconfig-logs

Conversation

@Himanshu2649

@Himanshu2649 Himanshu2649 commented Sep 26, 2026 •

Copy link
Copy Markdown

Description

ApplyOperation and ProcessOAM were logging the kubeconfigs they receive from Meshery Server at Info level. That printed cluster tokens, client keys and CA data straight to stdout, and from there into container logs. Both log lines now only show how many kubeconfigs came in.

- nighthawk.Log.Info("Processing request ", req)
+ nighthawk.Log.Info(fmt.Sprintf("Processing request with %d components and %d kubeconfigs", len(req.OamComps), len(req.K8sConfigs)))

- kubeConfigs := opReq.K8sConfigs
- nighthawk.Log.Info(fmt.Sprintf("Applying %s with kubeconfig %v: requested nighthawk-apater version %s", opReq.OperationName, kubeConfigs, requestedVersion))
+ nighthawk.Log.Info(fmt.Sprintf("Applying %s with %d kubeconfigs: requested nighthawk-apater version %s", opReq.OperationName, len(opReq.K8sConfigs), requestedVersion))

Notes for Reviewers

  • Only the log messages changed. The operation logic is the same.
  • I tested it by passing a sample kubeconfig through both handlers and checking the output. Before the change, the token, client key and CA data all showed up in the logs. After it, none of them do.
  • go build ./... and go vet pass.

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • Chores
    • Operational logs now show component and kubeconfig counts instead of full request and kubeconfig contents. Operation names and requested versions continue to be logged.

Signed-off-by: amritmc09 <hrai03820@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ffaa1ed6-03ee-4ead-9a06-a87126dee86b

📥 Commits

Reviewing files that changed from the base of the PR and between 96b1fb4 and 11394e2.

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

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The logging in ProcessOAM and ApplyOperation now reports component and kubeconfig counts instead of request or kubeconfig contents.

Changes

Request Logging

Layer / File(s) Summary
Update request logging
nighthawk/nighthawk.go
ProcessOAM logs component and kubeconfig counts. ApplyOperation logs the kubeconfig count with the operation name and requested version.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 11394

No merge-blocking risk is apparent from the supplied change context.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing kubeconfig contents from being logged in ApplyOperation and ProcessOAM.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant