Skip to content

[oadp-1.4] OADP-7829: Add additive extraArgs support for Velero server and node-agent - #2366

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:oadp-1.4from
kaovilai:OADP-7829-extraargs-nodeagent-oadp-1.4
Aug 10, 2026
Merged

[oadp-1.4] OADP-7829: Add additive extraArgs support for Velero server and node-agent#2366
openshift-merge-bot[bot] merged 1 commit into
openshift:oadp-1.4from
kaovilai:OADP-7829-extraargs-nodeagent-oadp-1.4

Conversation

@kaovilai

Copy link
Copy Markdown
Member

Cherry-pick of #2230 to oadp-1.4.

Why the changes were made

Currently, configuring additional Velero server or node-agent arguments requires using full argument overrides, which forces users to replicate the operator-generated defaults. This approach is difficult to maintain and can lead to configuration drift when defaults change in future releases.

This change introduces a new extraArgs field for both VeleroConfig and NodeAgentConfig. The field allows users to add or override specific command-line arguments while preserving the operator-managed defaults.

Key behaviors:

  • extraArgs are merged with the operator-generated arguments.
  • Existing arguments can be overridden by specifying the same flag in extraArgs.
  • Supports both --flag=value and --flag value argument formats.
  • Duplicate flags are deduplicated by flag name.
  • Unsupported-args annotations continue to have the highest precedence.

Precedence order:

Operator defaults / individual DPA fields / Args override
→ extraArgs
→ unsupported-args annotation ConfigMap

Adaptation notes for oadp-1.4

This branch's structure differs from oadp-dev, so the cherry-pick was adapted rather than applied verbatim:

  • Types live in api/v1alpha1/oadp_types.go (not dataprotectionapplication_types.go)
  • Controllers live in controllers/ (not internal/controller/)
  • server.Args embeds ServerConfig (not ServerFlags)
  • Dropped the NodeAgentConfig.DataMoverPrepareTimeout test case from the original PR since that field doesn't exist on this branch

How to test the changes made

  1. Deploy the operator with this change.

  2. Create a DPA with extraArgs configured:

spec:
  configuration:
    velero:
      extraArgs:
        resource-timeout: "20m"
        custom-flag: "value"
    nodeAgent:
      uploaderType: kopia
      extraArgs:
        custom-flag: "value1"
  1. Verify the Velero deployment contains the additional arguments:
oc get deployment velero -n openshift-adp -o json | jq '.spec.template.spec.containers[0].args'
  1. Verify the node-agent daemonset contains the additional arguments:
oc get daemonset node-agent -n openshift-adp -o json | jq '.spec.template.spec.containers[0].args'
  1. Verify that specifying an existing flag in extraArgs overrides the operator-generated value.

  2. Run the test suite:

make test

Note

Responses generated with Claude

…agent

Cherry-pick of openshift#2230 to oadp-1.4. Adapted for this branch's older
structure: types live in api/v1alpha1/oadp_types.go (not
dataprotectionapplication_types.go), controllers live in controllers/
(not internal/controller/), and server.Args uses ServerConfig (not
ServerFlags). The NodeAgentConfig.DataMoverPrepareTimeout-based test
case from the original PR was dropped since that field does not exist
on this branch.

Adds an extraArgs map[string]string field to VeleroConfig and
NodeAgentConfig, merged additively on top of operator-generated
defaults (and Args, for Velero), with the unsupported-args annotation
still taking highest precedence.

Co-authored-by: Shreyash <Shreyashxredhat@users.noreply.github.com>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 10, 2026

Copy link
Copy Markdown

@kaovilai: This pull request references OADP-7829 which is a valid jira issue.

Details

In response to this:

Cherry-pick of #2230 to oadp-1.4.

Why the changes were made

Currently, configuring additional Velero server or node-agent arguments requires using full argument overrides, which forces users to replicate the operator-generated defaults. This approach is difficult to maintain and can lead to configuration drift when defaults change in future releases.

This change introduces a new extraArgs field for both VeleroConfig and NodeAgentConfig. The field allows users to add or override specific command-line arguments while preserving the operator-managed defaults.

Key behaviors:

  • extraArgs are merged with the operator-generated arguments.
  • Existing arguments can be overridden by specifying the same flag in extraArgs.
  • Supports both --flag=value and --flag value argument formats.
  • Duplicate flags are deduplicated by flag name.
  • Unsupported-args annotations continue to have the highest precedence.

Precedence order:

Operator defaults / individual DPA fields / Args override
→ extraArgs
→ unsupported-args annotation ConfigMap

Adaptation notes for oadp-1.4

This branch's structure differs from oadp-dev, so the cherry-pick was adapted rather than applied verbatim:

  • Types live in api/v1alpha1/oadp_types.go (not dataprotectionapplication_types.go)
  • Controllers live in controllers/ (not internal/controller/)
  • server.Args embeds ServerConfig (not ServerFlags)
  • Dropped the NodeAgentConfig.DataMoverPrepareTimeout test case from the original PR since that field doesn't exist on this branch

How to test the changes made

  1. Deploy the operator with this change.

  2. Create a DPA with extraArgs configured:

spec:
 configuration:
   velero:
     extraArgs:
       resource-timeout: "20m"
       custom-flag: "value"
   nodeAgent:
     uploaderType: kopia
     extraArgs:
       custom-flag: "value1"
  1. Verify the Velero deployment contains the additional arguments:
oc get deployment velero -n openshift-adp -o json | jq '.spec.template.spec.containers[0].args'
  1. Verify the node-agent daemonset contains the additional arguments:
oc get daemonset node-agent -n openshift-adp -o json | jq '.spec.template.spec.containers[0].args'
  1. Verify that specifying an existing flag in extraArgs overrides the operator-generated value.

  2. Run the test suite:

make test

[!Note]
Responses generated with Claude

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.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6363f8d2-dabd-41c7-a59d-6f0933262332

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@shubham-pampattiwar shubham-pampattiwar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 10, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.47%. Comparing base (42938ce) to head (610b46d).

⚠️ Current head 610b46d differs from pull request most recent head fa0174f

Please upload reports for the commit fa0174f to get more accurate results.

Files with missing lines Patch % Lines
api/v1alpha1/zz_generated.deepcopy.go 0.00% 12 Missing ⚠️
pkg/common/common.go 95.16% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           oadp-1.4    #2366      +/-   ##
============================================
+ Coverage     37.79%   38.47%   +0.67%     
============================================
  Files            30       30              
  Lines          5033     5113      +80     
============================================
+ Hits           1902     1967      +65     
- Misses         2935     2949      +14     
- Partials        196      197       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Joeavaikath, kaovilai, shubham-pampattiwar, sseago

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:
  • OWNERS [Joeavaikath,kaovilai,shubham-pampattiwar,sseago]

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 commented Aug 10, 2026

Copy link
Copy Markdown

@kaovilai: 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 9f76fd7 into openshift:oadp-1.4 Aug 10, 2026
10 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants