Skip to content

Conversation

Copy link

Copilot AI commented Aug 19, 2025

This PR adds comprehensive documentation for the NonAdminDownloadRequest (NADR) feature, which was previously undocumented despite being fully implemented. The NADR feature allows non-admin users to download logs, backup contents, and other information related to their NonAdminBackup and NonAdminRestore operations through secure, time-limited signed URLs.

What's Added

📖 Comprehensive Documentation

  • docs/nadr_usage.md - Complete usage guide covering all aspects of NADR
  • Updated README.md - Integrated NADR workflow into the main user journey

🛠️ Sample Templates & Examples

  • hack/samples/downloads/ - OpenShift templates for common download scenarios:
    • backup-logs.yaml - Download backup operation logs
    • backup-contents.yaml - Download backup metadata and manifests
    • restore-logs.yaml - Download restore operation logs
    • backup-resource-list.yaml - Download list of backed up resources

🚀 Automation Tools

  • hack/nadr-download.sh - Helper script that automates the entire download process:
    # Simple one-command download
    ./hack/nadr-download.sh -k BackupLog -n my-backup -ns my-namespace

📋 Documentation Includes

Supported Download Types:

  • For Backups: BackupLog, BackupContents, BackupVolumeSnapshots, BackupItemOperations, BackupResourceList, BackupResults, CSIBackupVolumeSnapshots, CSIBackupVolumeSnapshotContents, BackupVolumeInfos
  • For Restores: RestoreLog, RestoreResults, RestoreResourceList, RestoreItemOperations, RestoreVolumeInfo

Multiple Usage Approaches:

  1. Manual YAML creation with kubectl/oc commands
  2. Template-based approach using OpenShift templates
  3. Automated workflow using the provided helper script

Complete Examples:

  • Creating NonAdminDownloadRequests for different scenarios
  • Downloading files using wget and curl with signed URLs
  • Status monitoring and condition checking
  • Error handling and troubleshooting

Troubleshooting Guide:

  • Common error conditions and their solutions
  • Status monitoring commands
  • Best practices for URL expiration handling
  • Debugging steps for failed downloads

Example Usage

# Create a download request for backup logs
apiVersion: oadp.openshift.io/v1alpha1
kind: NonAdminDownloadRequest
metadata:
  name: backup-logs-download
  namespace: my-app-namespace
spec:
  target:
    kind: BackupLog
    name: my-backup
# Wait for processing and download
oc wait --for=condition=Processed nadr/backup-logs-download -n my-namespace --timeout=300s
DOWNLOAD_URL=$(oc get nadr backup-logs-download -n my-namespace -o jsonpath='{.status.velero.status.downloadURL}')
wget "$DOWNLOAD_URL" -O backup-logs.tar.gz

The documentation provides production-ready guidance for users ranging from simple manual operations to full automation workflows, making the NADR feature accessible and easy to use.

Fixes #253.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Author

Copilot AI commented Aug 19, 2025

@kaovilai 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@oadp-snyk
Copy link

oadp-snyk commented Aug 19, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@openshift-ci
Copy link

openshift-ci bot commented Aug 19, 2025

Hi @Copilot. Thanks for your PR.

I'm waiting for a migtools member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci
Copy link

openshift-ci bot commented Aug 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot
Once this PR has been reviewed and has the lgtm label, please ask for approval from kaovilai. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@openshift-ci
Copy link

openshift-ci bot commented Aug 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot
Once this PR has been reviewed and has the lgtm label, please ask for approval from kaovilai. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI changed the title [WIP] Document usage of NADR feature Document usage of NADR (NonAdminDownloadRequest) feature Aug 19, 2025
Copilot AI requested a review from kaovilai August 19, 2025 17:32
Copilot finished work on behalf of kaovilai August 19, 2025 17:32
@kaovilai kaovilai marked this pull request as ready for review August 19, 2025 20:38
Copilot AI review requested due to automatic review settings August 19, 2025 20:38
@openshift-ci openshift-ci bot requested a review from mrnold August 19, 2025 20:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive documentation for the NonAdminDownloadRequest (NADR) feature, which was previously undocumented. The NADR feature allows non-admin users to download logs, backup contents, and other information from their NonAdminBackup and NonAdminRestore operations through secure, time-limited signed URLs.

  • Complete documentation including usage guide, troubleshooting, and best practices
  • OpenShift templates for common download scenarios (backup logs, contents, restore logs, resource lists)
  • Automated helper script for streamlined download workflow

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/nadr_usage.md Comprehensive usage guide with examples, troubleshooting, and supported download types
hack/nadr-download.sh Automated script that handles NADR creation, processing, and file download
hack/samples/downloads/ OpenShift templates for common download scenarios
config/samples/oadp_v1alpha1_nonadmindownloadrequest.yaml Enhanced sample with detailed comments
README.md Integrated NADR workflow into main user journey

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

local kind="$1"
local name="$2"
local timestamp=$(date +%Y%m%d-%H%M%S)
echo "${name}-${kind,,}-${timestamp}.tar.gz"
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The use of ${kind,,} for case conversion may not be available in all shell environments. Consider using tr for better portability: echo "${name}-$(echo "$kind" | tr '[:upper:]' '[:lower:]')-${timestamp}.tar.gz"

Suggested change
echo "${name}-${kind,,}-${timestamp}.tar.gz"
echo "${name}-$(echo "$kind" | tr '[:upper:]' '[:lower:]')-${timestamp}.tar.gz"

Copilot uses AI. Check for mistakes.

# Set default request name if not provided
if [[ -z "$REQUEST_NAME" ]]; then
REQUEST_NAME="${NAME,,}-${KIND,,}-download-$(date +%s)"
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The use of ${NAME,,} and ${KIND,,} for case conversion may not be available in all shell environments. Consider using tr for better portability: REQUEST_NAME="$(echo "$NAME" | tr '[:upper:]' '[:lower:]')-$(echo "$KIND" | tr '[:upper:]' '[:lower:]')-download-$(date +%s)"

Suggested change
REQUEST_NAME="${NAME,,}-${KIND,,}-download-$(date +%s)"
REQUEST_NAME="$(echo "$NAME" | tr '[:upper:]' '[:lower:]')-$(echo "$KIND" | tr '[:upper:]' '[:lower:]')-download-$(date +%s)"

Copilot uses AI. Check for mistakes.
# Check if the referenced backup/restore exists
if [[ "$KIND" == *"Backup"* || "$KIND" == *"backup"* ]]; then
log "Checking if NonAdminBackup '$NAME' exists in namespace '$NAMESPACE'"
if ! oc get nab "$NAME" -n "$NAMESPACE" &> /dev/null; then
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

[nitpick] The script uses shorthand 'nab' for NonAdminBackup which may not be clear to all users. Consider using the full resource name 'nonadminbackup' for clarity, or add a comment explaining the abbreviation.

Suggested change
if ! oc get nab "$NAME" -n "$NAMESPACE" &> /dev/null; then
if ! oc get nonadminbackup "$NAME" -n "$NAMESPACE" &> /dev/null; then

Copilot uses AI. Check for mistakes.
fi
else
log "Checking if NonAdminRestore '$NAME' exists in namespace '$NAMESPACE'"
if ! oc get nar "$NAME" -n "$NAMESPACE" &> /dev/null; then
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

[nitpick] The script uses shorthand 'nar' for NonAdminRestore which may not be clear to all users. Consider using the full resource name 'nonadminrestore' for clarity, or add a comment explaining the abbreviation.

Suggested change
if ! oc get nar "$NAME" -n "$NAMESPACE" &> /dev/null; then
if ! oc get nonadminrestore "$NAME" -n "$NAMESPACE" &> /dev/null; then

Copilot uses AI. Check for mistakes.
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.

Document usage of NADR feature

3 participants