Skip to content

CRD updates for the oc CLI fields for the NAR, NAB and NABSL objects#1648

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
mpryc:issue_232_oc_get_fields
Mar 20, 2025
Merged

CRD updates for the oc CLI fields for the NAR, NAB and NABSL objects#1648
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
mpryc:issue_232_oc_get_fields

Conversation

@mpryc
Copy link
Copy Markdown
Contributor

@mpryc mpryc commented Feb 28, 2025

Needed-by: migtools/oadp-non-admin#245

Implements migtools/oadp-non-admin#232 with additional fields for:

  • NonAdminBackup
  • NonAdminRestore
  • NonAdminBackupStorageLocation

Why the changes were made

migtools/oadp-non-admin#232 and add similar fields for the NAB and NAR objects.

How to test the changes made

  1. Deployed with local oadp-operator deployment
  2. Tested various objects and it's states:

Prior admin approval or rejections

Created couple of BSLs - names reflect the idea behind each of them

  • suspicious-nabsl (reject)
  • nonexistingsecretinns-nabsl (do nothing - no nabslrequest)
  • waitingapproval-nabsl (do nothing)
  • incorrect-bucket-nabsl (approve)
  • perfect-nabsl (approve)

Before any admin action:

$ oc get nabsl -n non-admin-bsl-test
NAME                          REQUEST-APPROVED   REQUEST-PHASE  VELERO-PHASE       AGE
incorrect-bucket-nabsl        False              New                               2m11s
nonexistingsecretinns-nabsl                      BackingOff                        39s
perfect-nabsl                 False              New                               2m40s
suspicious-sample             False              New                               10s
waitingapproval-nabsl         False              New                               94s

Note the nonexistingsecretinns-nabsl have not created request - the user must create secret to get to that state

$ oc get nabslrequest
NAME                                                              REQUEST-PHASE   REQUEST-NAMESPACE     REQUEST-NAME
non-admin-bsl-test-incorre-9aa22872-f39d-427c-b352-6924ff9c2175   Pending         non-admin-bsl-test    incorrect-bucket-nabsl
non-admin-bsl-test-perfect-4413c67d-8eb8-42bc-8274-279a91895196   Pending         non-admin-bsl-test    perfect-nabsl
non-admin-bsl-test-suspici-4fbdcebf-2277-4f44-890e-35d765815e1a   Pending         non-admin-bsl-test    suspicious-sample
non-admin-bsl-test-waiting-fcae28c2-d8ea-48e2-a35c-8882bfd865e0   Pending         non-admin-bsl-test    waitingapproval-nabsl

Approving or rejecting some:

$ oc get nabslrequest
NAME                                                              REQUEST-PHASE   REQUEST-NAMESPACE     REQUEST-NAME               AGE
non-admin-bsl-test-incorre-9aa22872-f39d-427c-b352-6924ff9c2175   Approved        non-admin-bsl-test    incorrect-bucket-nabsl    4m57s
non-admin-bsl-test-perfect-4413c67d-8eb8-42bc-8274-279a91895196   Approved        non-admin-bsl-test    perfect-nabsl             5m26s
non-admin-bsl-test-suspici-4fbdcebf-2277-4f44-890e-35d765815e1a   Rejected        non-admin-bsl-test    suspicious-sample         2m56s
non-admin-bsl-test-waiting-fcae28c2-d8ea-48e2-a35c-8882bfd865e0   Pending         non-admin-bsl-test    waitingapproval-nabsl     4m20s

Now the NABSL objects

$ oc get nabsl -n non-admin-bsl-test
NAME                          REQUEST-APPROVED   REQUEST-PHASE   VELERO-PHASE   AGE
incorrect-bucket-nabsl        True               Created         Unavailable    8m25s
nonexistingsecretinns-nabsl                      BackingOff                     6m53s
perfect-nabsl                 True               Created         Available      8m54s
suspicious-sample             False              BackingOff                     6m24s
waitingapproval-nabsl         False              New                            7m48s
Backup

Couple of backup objects were created

$ oc get nab -n non-admin-bsl-test
NAME                       REQUEST-PHASE   VELERO-PHASE       AGE
backup-failed-sample       Created         PartiallyFailed    6s
incorrect-bsl-backup       BackingOff                         3m39s
some-backup                Created         Completed          13s

Restore

Nice InProgress and Completed status:

$ oc get nar -n non-admin-bsl-test
NAME               REQUEST-PHASE   VELERO-PHASE   AGE
non-existing-nab   BackingOff                     46s

$ oc get nar -n non-admin-bsl-test
NAME               REQUEST-PHASE   VELERO-PHASE   AGE
existing-nab       Created         InProgress     1s
non-existing-nab   BackingOff                     51s

$ oc get nar -n non-admin-bsl-test
NAME               REQUEST-PHASE   VELERO-PHASE   AGE
existing-nab       Created         Completed      3s
non-existing-nab   BackingOff                     53s

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 28, 2025
@mpryc

This comment was marked as outdated.

@mateusoliveira43

This comment was marked as outdated.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 28, 2025
@shubham-pampattiwar
Copy link
Copy Markdown
Member

shubham-pampattiwar commented Mar 5, 2025

@mpryc Would the non-admin user get confused between the columns backup-status and status and similarly for restores and bsls ?

@weshayutin
Copy link
Copy Markdown
Contributor

@mpryc Would the non-admin user get confused between the columns backup-status and status and similarly for restores and bsls ?

hrm.. I like the way you are thinking but IMHO naming things is hard. Do you have a more clear term? Docs can handle the differences. This is a very nice update for ease of use and transparency to users.

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 5, 2025

we could have BACKUP-STATUS and CRD-STATUS ?

@shubham-pampattiwar
Copy link
Copy Markdown
Member

@weshayutin @mpryc How about these alternatives:

  • BACKUP-STATUS --> VELERO-STATUS OR BACKUP-PHASE OR PHASE
  • STATUS --> REQUEST-STATUS OR PROCESSING STATUS

@kaovilai
Copy link
Copy Markdown
Member

kaovilai commented Mar 5, 2025

Do you have a more clear term?

Yes I do. Velero Status and NA<C/B/R> Status

@kaovilai
Copy link
Copy Markdown
Member

kaovilai commented Mar 5, 2025

CRD-STATUS does not help. It does not tell user where signals came from.

User want to know if a status column belongs to NAC or Velero.

@weshayutin
Copy link
Copy Markdown
Contributor

CRD-STATUS does not help. It does not tell user where signals came from.

User want to know if a status column belongs to NAC or Velero.

I think what Tiger is saying makes a lot of sense. NOW PLEASE NEVER MAKE ME SAY THAT AGAIN.

@shubham-pampattiwar
Copy link
Copy Markdown
Member

just use PHASE instead of STATUS ?

  • VELERO-BACKUP-PHASE and NAB-PHASE or just PHASE

Note: I don't know how popular our CR shortname (NAB/NAR) would be and the UX of using it in printer column, I am ok with either NAB-PHASE or just PHASE

@kaovilai
Copy link
Copy Markdown
Member

kaovilai commented Mar 5, 2025

If shorter = better then my final suggestion is

Phase for nac orignated phases
Velero for velero CR originated status/phase

@mateusoliveira43

This comment was marked as outdated.

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 6, 2025
@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 6, 2025

After reading all the comments above and suggestions.

Proposed Naming Convention:

Object Current Column Proposed Change
NABSL STATUS NAC-PHASE
NABSL BSL-STATUS VELERO-PHASE
NAB STATUS NAC-PHASE
NAB BACKUP-STATUS VELERO-PHASE
NAR STATUS NAC-PHASE
NAR RESTORE-STATUS VELERO-PHASE

@weshayutin
Copy link
Copy Markdown
Contributor

/retest-required

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 14, 2025

@mpryc: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.15-e2e-test-kubevirt-aws c0d412f link true /test 4.15-e2e-test-kubevirt-aws
ci/prow/4.17-e2e-test-aws c0d412f link true /test 4.17-e2e-test-aws

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.

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 14, 2025

Are we set on the names ?
If those are ok I will update PR: #1648 (comment)

@shubham-pampattiwar
Copy link
Copy Markdown
Member

Are we set on the names ? If those are ok I will update PR: #1648 (comment)

IMO
Key changes:

  • dropped NAC prefix as the column is on NAC object so not needed
  • VELERO <-> VELERO-OBJ as VELERO in most cases means the controller
Object Current Column Proposed Change
NABSL STATUS PHASE
NABSL BSL-STATUS VELERO-OBJ-PHASE
NAB STATUS PHASE
NAB BACKUP-STATUS VELERO-OBJ-PHASE
NAR STATUS PHASE
NAR RESTORE-STATUS VELERO-OBJ-PHASE

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 16, 2025

@shubham-pampattiwar I think the VELERO-OBJ-PHASE might be overkill, I know the VELERO-PHASE is not extremely precise, but our context already makes it clear that this refers to the phase of a Velero-managed object, adding -OBJ feels redundant ??

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 16, 2025

We could think of user and then we could have "Request vs. Execution" naming:

Object Current Column Proposed Change
NABSL STATUS REQUEST-PHASE
NABSL BSL-STATUS PHASE
NAB STATUS REQUEST-PHASE
NAB BACKUP-STATUS PHASE
NAR STATUS REQUEST-PHASE
NAR RESTORE-STATUS PHASE

Our Request is really a status of progression of the NonAdmin request itself it finishes at Created phase and our PHASE is actually WORKER that does the job, which could be simplified to PHASE instead of WORKER-PHASE or EXECUTION-PHASE ?
https://github.com/migtools/oadp-non-admin/blob/a46d4d8ee69fb084a2c027b65b5241bb551f8e94/api/v1alpha1/nonadmin_types.go#L23-L33

@weshayutin
Copy link
Copy Markdown
Contributor

@anarnold97 perhaps you can suggest some language to properly describe and delineate the nonadmin objects status/phase vs the velero status/phase since we're doing such a poor job of it :) Any thoughts are welcome sir

@anarnold97
Copy link
Copy Markdown
Contributor

anarnold97 commented Mar 18, 2025 via email

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 19, 2025

Object Column Description
NABSL PHASE Phase of the Non Admin Backup Storage Location (NABSL) object
NABSL VELERO-PHASE Phase from the Velero Backup Storage Location object
NAB PHASE Phase of the Non Admin Backup (NAB) object
NAB VELERO-PHASE Phase from the Velero Backup object
NAR PHASE Phase of the Non Admin Restore (NAR) object
NAR VELERO-PHASE Phase from the Velero Restore object

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 19, 2025

Thanks @shdeshpa07 and @anarnold97 will make those adjustments, let me know if anything changes to the proposed column names, but for the moment those suggestions are great.

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 19, 2025

Ok final agreement I think. After offline slack conversations:

Object Column NAME Description
NABSL REQUEST-PHASE Phase of the Non Admin Backup Storage Location (NABSL) object
NABSL VELERO-PHASE Phase from the Velero Backup Storage Location object
NAB REQUEST-PHASE Phase of the Non Admin Backup (NAB) object
NAB VELERO-PHASE Phase from the Velero Backup object
NAR REQUEST-PHASE Phase of the Non Admin Restore (NAR) object
NAR VELERO-PHASE Phase from the Velero Restore object

Implements openshift#232 with additional fields for:
 - NonAdminBackup
 - NonAdminRestore
 - NonAdminBackupStorageLocation

Signed-off-by: Michal Pryc <mpryc@redhat.com>
@mpryc mpryc force-pushed the issue_232_oc_get_fields branch from c0d412f to 60e3b13 Compare March 20, 2025 10:00
@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 20, 2025

Updated, please refer to the following comment for details: #1648 (comment)

In the PR description there are updated column names and it's order to reflect current implementation:
#1648 (comment)

@mpryc
Copy link
Copy Markdown
Contributor Author

mpryc commented Mar 20, 2025

/retest

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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 [kaovilai,mpryc,shubham-pampattiwar]

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

@kaovilai
Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2025
@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 6800217 and 2 for PR HEAD 60e3b13 in total

@openshift-merge-bot openshift-merge-bot Bot merged commit fea6566 into openshift:master Mar 20, 2025
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants