Skip to content

Conversation

NicholasYancey
Copy link
Contributor

Why the changes were made

Need the kubectl plugin design document peer reviewed

How to test the changes made

Please read

@openshift-ci openshift-ci bot requested review from kaovilai and sseago June 24, 2025 16:29
Copy link

openshift-ci bot commented Jun 24, 2025

Hi @NicholasYancey. Thanks for your PR.

I'm waiting for a openshift 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 openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 24, 2025
@weshayutin weshayutin added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 24, 2025
Comment on lines 21 to 24
oc oadp backup create
oc oadp backup logs
oc oadp restore create
oc oadp restore logs
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to have some markdown code decorations for the code here.

Suggested change
oc oadp backup create
oc oadp backup logs
oc oadp restore create
oc oadp restore logs
```sh
oc oadp backup create
oc oadp backup logs
oc oadp restore create
oc oadp restore logs
```

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@weshayutin weshayutin added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 24, 2025
@kaovilai kaovilai requested a review from Copilot June 25, 2025 22:51
Copilot

This comment was marked as outdated.


## Goals
- Customers can create backups and restores
- A non-cluster admin can create Non-Admin-Backups (NAB)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would the non-admin backup/restore API calls be different? Since the CRDs are different, I imagine those would need different APIs here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sseago you are correct, however because we are limited in time based on the internship timeframe. This design is only going to cover NAB's.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the CLI compatibility across different OADP versions in-scope ?

  • How you will tell the user that the CRD is not available on the system for Non Admin use case if the user tries to use this CLI against older OADP deployment. This is of course only for NAB due to time constrains.

Copy link
Contributor

Choose a reason for hiding this comment

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

@weshayutin Oh, wait -- this is for NABs and not Velero backups? Oh, that wasn't clear from the mention of backups and restores. In that case, we need to be clear by referencing NABs and NARs and not Backups and Restores elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed doc to make it more clear to the reader

@weshayutin
Copy link
Contributor

@shubham-pampattiwar @mpryc please provide a review today, tomorrow so we can get this through.


## Non-Goals
- Non-Admin-Restore due to time constraints

Copy link
Member

Choose a reason for hiding this comment

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

Lets add a use-case section too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@mpryc mpryc left a comment

Choose a reason for hiding this comment

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

Clear design with small parts for further improvement (not a must, but nice to have).


## Goals
- Customers can create backups and restores
- A non-cluster admin can create Non-Admin-Backups (NAB)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the CLI compatibility across different OADP versions in-scope ?

  • How you will tell the user that the CRD is not available on the system for Non Admin use case if the user tries to use this CLI against older OADP deployment. This is of course only for NAB due to time constrains.

## High-Level Design
Creating a kubectl plugin (kubectl-oadp) will be a good solution to the problem at hand. It will be able to create/delete backups and restores. Non-cluster admin will be able to create NABs without the need for cluster admin to do it for them.

## Detailed Design
Copy link
Contributor

Choose a reason for hiding this comment

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

What plugin installation process will look like?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will leave it out of the design doc for now, but using krew for installations would be nice in the future

@weshayutin weshayutin changed the title DNM Design For OADP CLI NVP Design For OADP CLI NVP Jul 2, 2025
@weshayutin weshayutin changed the title Design For OADP CLI NVP Design For OADP CLI MVP Jul 2, 2025
@weshayutin
Copy link
Contributor

LET'S GO, move move move!

@kaovilai kaovilai requested a review from Copilot July 2, 2025 14:42
Copilot

This comment was marked as outdated.

@kaovilai kaovilai requested a review from Copilot July 2, 2025 17:08
Copy link
Contributor

@Copilot 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 a design document for the kubectl-oadp CLI plugin, outlining its purpose, architecture, and usage.

  • Defines goals, non-goals, and use cases for both regular and non-admin backups/restores
  • Presents high-level and detailed design with Go code snippets and CLI examples
  • Covers security considerations, compatibility, and future work
Comments suppressed due to low confidence (2)

docs/design/kubectl-oadp.md:20

  • Align this CLI usage with the examples below—use kubectl oadp nonadmin backup create [backupName] instead of kubectl oadp create nonadmin backup [backupname].
Creating a kubectl plugin (kubectl-oadp) will be a good solution to the problem at hand. It will be able to create/delete backups and restores. Non-cluster admin will be able to create NABs without the need for cluster admin to do it for them. A way to distinguish between creating either NABs or regular backups would be in the cli. For intstance, if you would like to create a NAB, you would have to do kubectl oadp create nonadmin backup [backupname].  

docs/design/kubectl-oadp.md:72

  • Fix the misspelling in the error message to 'Unauthorized Access'.
The security for the plugin is controlled by OpenShift RBAC, which allows cluster admins to control permissions of users below it. This is untilized to allows users to only be allowed to use the commands that they have permission to use by their namespace. The plugin would also create error statements like "Unautherized Access" whenever a user who does not have the right permissions tries to do unautherized commands.

Copy link
Member

@shubham-pampattiwar shubham-pampattiwar left a comment

Choose a reason for hiding this comment

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

Some NITs and suggestions here and there.
Overall looks good ! Awesome job @NicholasYancey @Joeavaikath !

Copy link

openshift-ci bot commented Jul 2, 2025

@NicholasYancey: all tests passed!

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.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2025
Copy link
Contributor

@weshayutin weshayutin left a comment

Choose a reason for hiding this comment

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

Nice work here. It takes time and work to thoroughly communicate details with regards to your intentions, plans and how you intend to implement an idea. If this design were not time constrained I suspect we would have gone a few more rounds of updates and reviews.

Copy link

openshift-ci bot commented Jul 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai, NicholasYancey, shubham-pampattiwar, weshayutin

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

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

@weshayutin weshayutin removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2025
@sseago
Copy link
Contributor

sseago commented Jul 3, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2025
@weshayutin weshayutin merged commit b3e7f02 into openshift:master Jul 3, 2025
4 of 6 checks passed
kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Jul 11, 2025
* DNM Design For OADP CLI NVP

* Crucial edits to Design Doc

* Update docs/design/kubectl-oadp.md

Co-authored-by: Copilot <[email protected]>

* Small edits to Design Doc

* Much needed changes to Design Doc

* Update docs/design/kubectl-oadp.md

Co-authored-by: Copilot <[email protected]>

* Update docs/design/kubectl-oadp.md

Co-authored-by: Copilot <[email protected]>

* Update docs/design/kubectl-oadp.md

Co-authored-by: Copilot <[email protected]>

* Update docs/design/kubectl-oadp.md

Co-authored-by: Copilot <[email protected]>

* Update docs/design/kubectl-oadp.md

Co-authored-by: Tiger Kaovilai <[email protected]>

* Finishing touches to Design Doc

* Update docs/design/kubectl-oadp.md

Co-authored-by: Tiger Kaovilai <[email protected]>

---------

Co-authored-by: Nicholas Yancey <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Tiger Kaovilai <[email protected]>
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants