-
Notifications
You must be signed in to change notification settings - Fork 84
Add uploader-type argument to Velero deployment configuration when configuration.args is used. #2019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: oadp-dev
Are you sure you want to change the base?
Conversation
…nfiguration.args is used. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
WalkthroughThe PR adds logic to re-append the uploader-type argument to the Velero container invocation when NodeAgent.UploaderType is configured, since GetArgs() does not include this value. The test is updated to expect this argument in the final Velero deployment configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick oadp-1.5 |
|
@kaovilai: once the present PR merges, I will cherry-pick it on top of In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (2)
internal/controller/velero.go(1 hunks)internal/controller/velero_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
internal/controller/velero.gointernal/controller/velero_test.go
🔇 Additional comments (1)
internal/controller/velero.go (1)
682-689: ****The review comment is based on an incorrect assumption about
GetArgs()behavior. Verification confirms:
GetArgs()(inpkg/velero/server/args.go) only processesdpa.Spec.Configuration.Velero.Argsand contains no uploader-type handling whatsoever.uploader-typecomes fromdpa.Spec.Configuration.NodeAgent.UploaderType— a separate configuration source.- The code comment at lines 682-683 correctly explains this separation.
- Test cases confirm the current argument ordering and inclusion of
--uploader-typeis expected behavior.The duplicate check concern is unfounded since these are from different config sources, and argument ordering is correct.
Likely an incorrect or invalid review comment.
|
@kaovilai: The following tests failed, say
Full PR test history. Your PR dashboard. 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. |
Problem
When
spec.configuration.velero.argsis used to customize Velero server arguments, the--uploader-typeflag gets lost. This happens because:--uploader-typeis set viainstall.WithUploaderType()based onspec.configuration.nodeAgent.uploaderTypespec.configuration.velero.argsis specified,veleroserver.GetArgs()completely rebuilds the args array from scratch--uploader-typecomes from NodeAgent config (not Velero.Args), it gets overwrittenThis was previously fixed in commit 3739f23 (May 2024) but regressed in commit b51ce21 (August 2024).
Solution
After calling
GetArgs(), check ifNodeAgent.UploaderTypeis configured and re-append the--uploader-typeflag to preserve it.Verification
Tested with:
go test -v -run TestDPAReconciler_buildVeleroDeployment/valid_DPA_CR_with_Velero_Args_burst_and_qps✅ All 58 tests passed. The test case now correctly verifies that
--uploader-type=kopiaappears in Velero container args even when customVelero.Argsare specified.Expected Args Order
https://redhat-internal.slack.com/archives/C0144ECKUJ0/p1760474313952109