Pass --log-level to NodeAgent DaemonSet container args#2139
Pass --log-level to NodeAgent DaemonSet container args#2139kaovilai wants to merge 1 commit intoopenshift:oadp-devfrom
Conversation
The DPA LogLevel field was only passed to the Velero server deployment but not to the NodeAgent DaemonSet. This meant data mover pods spawned by the exposer could not inherit the log level from the node-agent, since the exposer reads --log-level from the node-agent container args. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdded conditional injection of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@kaovilai isn't there a jira on this ??? |
There was a problem hiding this comment.
Pull request overview
This PR propagates spec.configuration.velero.logLevel from the DataProtectionApplication (DPA) CR into the NodeAgent DaemonSet container args, aligning node-agent logging behavior with the Velero server deployment.
Changes:
- Append
--log-level=<value>to the node-agent container args whendpa.Spec.Configuration.Velero.LogLevelis set. - Extend node-agent daemonset unit test scaffolding to support asserting log-level.
- Add a unit test case validating
LogLevel=debugresults in--log-level=debugon the NodeAgent DaemonSet.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/controller/nodeagent.go | Passes DPA Velero logLevel into the node-agent DaemonSet container args. |
| internal/controller/nodeagent_test.go | Adds test builder support and a unit test case asserting node-agent receives --log-level. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if dpa.Spec.Configuration.Velero.LogLevel != "" { | ||
| nodeAgentContainer.Args = append(nodeAgentContainer.Args, fmt.Sprintf("--log-level=%s", dpa.Spec.Configuration.Velero.LogLevel)) | ||
| } |
There was a problem hiding this comment.
PR description references getInheritedPodInfo in pkg/exposer/image.go, but there is no pkg/exposer package (and no getInheritedPodInfo symbol) in this repository. Please update the PR description to point at the correct code path in this repo that consumes the node-agent --log-level arg, or clarify that it’s referring to an external component/repo.
|
no jira yet.. thread |
|
/retest |
|
@kaovilai: 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, sseago, weshayutin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
nodeagent will error out if that happens. Our CRD also have these markers to block invalid values. oadp-operator/api/v1alpha1/dataprotectionapplication_types.go Lines 322 to 323 in 3cceb1e |
Summary
--log-levelfromdpa.Spec.Configuration.Velero.LogLevelto NodeAgent DaemonSet container argsgetInheritedPodInfoinpkg/exposer/image.go)Request: https://redhat-internal.slack.com/archives/C0144ECKUJ0/p1772820634393599
Test plan
go test ./internal/controller/ -run TestDPAReconciler_buildNodeAgentDaemonsetpasseslogLevel: debugin DPA and verify node-agent pod has--log-level=debugin args🤖 Generated with Claude Code
via Happy