Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify the Non Admin Backup API deletion to align with sync controller #148

Merged

Conversation

mpryc
Copy link
Collaborator

@mpryc mpryc commented Jan 23, 2025

Non Admin Backup delete event should remove corresponding Velero Backup

This allows Velero Sync controller to recreate Velero Backup object and cascate such recreation back to the Non Admin Backup. The cascade action is a responsibility of an Non Admin Sync controller.

Why the changes were made

Those changes are made to allow sync controller that is implemented as part of the #38 implemented by #138 to recreate Non Admin Backup in unified way, meaning it will be recreated on the new Velero Backup recreation by the Velero Sync controller.

In other words with this behavior when user runs:

$ oc delete <non-admin-backup> -n mynamespace

This will result in removal of associated Velero Backup (if was existing) and then removal of NAB finalizer.
Such action will cause s3 storage to still have the information about the Velero Backup, because the removal was not done via spec field and no DeleteBackupRequest was created.
With the s3 storage containing information about Velero Backup, the Velero Sync Controller will recreate the Velero Backup object in the openshift-adp namespace. That event should trigger Non Admin Backup Sync Controller implemented as part of the #138 to recreate Non Admin Backup in the user's namespace.

How to test the changes made

e2e tests were written, run simulation tests

@mpryc mpryc force-pushed the bsl-deletion-workflow-update branch from 9189998 to 41f2d4d Compare January 23, 2025 10:40
Non Admin Backup delete event should remove corresponding Velero Backup

This allows Velero Sync controller to recreate Velero Backup object and
cascate such recreation back to the Non Admin Backup. The cascade action
is a responsibility of an Non Admin Sync controller.

Signed-off-by: Michal Pryc <[email protected]>
@mpryc mpryc force-pushed the bsl-deletion-workflow-update branch from 41f2d4d to 9ee0f0f Compare January 23, 2025 16:12
kaovilai

This comment was marked as resolved.

@mpryc

This comment was marked as resolved.

mpryc added 2 commits January 24, 2025 14:38
Removal of the ForceDelete from the Backup Spec:
 - The standard API delete will handle now deletion of the
   associated with Non Admin Backup object
   Velero Backup and Velero DownloadBackupRequests
 - If the deletion of DownloadBackupRequest fails, there is still
   Velero garbage colletion mechanism, which should clean those object
   from the cluster.

User is still reqreuired to use deleteBackup Spec field to clean up
all the Backup resources including S3 artefacts.

Signed-off-by: Michal Pryc <[email protected]>
Remove unnecessary flag and improve implementation
of the tests for the NAB controller.

Signed-off-by: Michal Pryc <[email protected]>
@mpryc
Copy link
Collaborator Author

mpryc commented Jan 27, 2025

/retest

@mpryc
Copy link
Collaborator Author

mpryc commented Jan 27, 2025

All the jobs are passing, is there anything else I should change in this PR to get it merged?

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.

/lgtm

Copy link

openshift-ci bot commented Jan 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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 [mateusoliveira43,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

@openshift-merge-bot openshift-merge-bot bot merged commit 25e40d6 into migtools:master Jan 27, 2025
8 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.

4 participants