Skip to content

Conversation

@Joeavaikath
Copy link
Contributor

@Joeavaikath Joeavaikath commented Jan 29, 2026

Why the changes were made

Update command output and help text to show "oc oadp" instead of "velero" for better user experience.

  • Add "oc" prefix when replacing velero command references
  • Wrap RunE functions to capture and replace runtime output
  • Update usage template to show "oc oadp" in help text

Example: velero backup describeoc oadp backup describe

  • Add the get command for NABSL
    oc oadp nonadmin bsl get

How to test the changes made

Run oc oadp backup create and check the output
Run any help command and see that usage has the oc prefix

Fixes #102, #49

Joeavaikath and others added 4 commits January 29, 2026 11:29
Update command output and help text to show "oc oadp" instead of
"velero" for better user experience.

- Add "oc" prefix when replacing velero command references
- Wrap RunE functions to capture and replace runtime output
- Update usage template to show "oc oadp" in help text

Example: `velero backup describe` → `oc oadp backup describe`

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
Implements get command for NonAdminBackupStorageLocation resources
with support for both verb-first and noun-first syntax:
- oc oadp nonadmin get bsl
- oc oadp nonadmin bsl get

The table output displays NAME, REQUEST PHASE, PROVIDER, BUCKET/PREFIX,
and AGE. Supports -o yaml/json output formats.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
Adds test coverage for BSL get and create commands:
- Tests for noun-first order (nonadmin bsl get/create)
- Tests for verb-first order (nonadmin get/create bsl)
- Tests for shorthand alias 'na'
- Tests for help flags (--help and -h)
- Tests for command structure and availability
- Tests for client config integration
- Tests for proper flag registration
- Tests for output format verification (oc oadp prefix)

These tests ensure both command orders work correctly and help
text shows the proper "oc oadp" prefix throughout.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
Update root_test.go tests to expect "oc oadp" instead of just "oadp"
to match the behavior introduced in commit 775fbcc.

Also fix a bug in replaceVeleroCommandWithOADP where newlines were not
properly handled. The function now preserves newlines when replacing
velero commands, ensuring multi-line examples are formatted correctly.

Changes:
- Update all test expectations from "oadp" to "oc oadp"
- Add newline (\n) to the HasPrefix check in replacement function
- Add debug output to MultipleOccurrences test for better diagnostics

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
The CLI binary build was timing out in CI after 30 seconds, causing
test failures with "signal: killed". This increases the build timeout
from 30 seconds to 2 minutes to accommodate slower CI environments.

The TestTimeout constant remains at 30 seconds for running commands,
while the new BuildTimeout constant of 2 minutes is used specifically
for the binary build step which requires more time in CI due to:
- Limited CPU resources
- Cold build caches
- Network latency for dependencies

Fixes test failures in CI with "Failed to build CLI binary: signal: killed"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
@Joeavaikath Joeavaikath merged commit 222df40 into migtools:oadp-dev Jan 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instructions after creating backup are misleading and should contain full command not just the arg to the oc/kubectl

1 participant