CLI - pvbackup create, schedule, sync, restore and delete
Describe what this PR does The backup and restore is based on restic utility.
Create:
- Create the secret referring restic config file
- Create the replication source
- Save the details to relationship file
Schedule:
- Set schedule on the replication source for
- Scheduled backups
Sync:
- Trigger single manual backup by setting manual trigger
Restore
- Create the NS, pvc, secret if doesn't exist or use the same if exists
- Pause ReplicationSource
- Create ReplicationDestination and trigger the restore
- Unpause the ReplicationSource
- Save the details to relationship file
Delete:
- Delete the replicationSource/replicationDestination relationship
- Delete the secret
- Delete the relationship file
Related issues: #193
Signed-off-by: Vinayakswami Hariharmath [email protected]
/cc @JohnStrunk
/retest
/retest
/hold
/unhold
/cc @JohnStrunk
I'm having a bit of trouble untangling the usage a bit... There are 5 sub commands here: create, delete, restore, schedule, and sync. I assume that the intention is that a given pvbackup relationship would be either a backup or a restore, not both? (the pause code is what's confusing me). Assuming this to be true:
- Backup flow would be: create -> (optional schedule / sync calls) -> delete
- Restore flow: restore -> delete We should probably rename "create" to "backup".
I am thinking how to make command (pv-backup) and option (create ==> backup) look bit nice. If I rename create to backup then it will be kubectl volsync pv-backup backup ....
Any suggestion for the name of the command ? Even for restore, the command is pv-backup which is not complementing well.
/retest
I'm having a bit of trouble untangling the usage a bit... There are 5 sub commands here: create, delete, restore, schedule, and sync. I assume that the intention is that a given pvbackup relationship would be either a backup or a restore, not both? (the pause code is what's confusing me). Assuming this to be true:
- Backup flow would be: create -> (optional schedule / sync calls) -> delete
- Restore flow: restore -> delete We should probably rename "create" to "backup".
I am thinking how to make
command (pv-backup)andoption (create ==> backup)look bit nice. If I renamecreatetobackupthen it will bekubectl volsync pv-backup backup ....Any suggestion for the name of the command ? Even for
restore, the command ispv-backupwhich is not complementing well.
Maybe my suggestion wasn't so good... We could stick with the create/restore. Would changing the top-level command make it read any better? You do "create" a backup and then "restore" it later.
$ kubectl volsync backup create ...
$ kubectl volsync backup restore ...
The part I'm struggling with is that the other commands require you to "create" a relationship, and that's what we've used the create for. Whereas here, you don't need to issue a create before a restore (for a given relationship). I don't know what to suggest.
/retest
/retest
Codecov Report
Merging #208 (ba3788f) into main (81fd412) will decrease coverage by
4.7%. The diff coverage is6.4%.
:exclamation: Current head ba3788f differs from pull request most recent head 32a2a20. Consider uploading reports for the commit 32a2a20 to get more accurate results
@@ Coverage Diff @@
## main #208 +/- ##
=======================================
- Coverage 60.4% 55.7% -4.8%
=======================================
Files 36 50 +14
Lines 4061 5911 +1850
=======================================
+ Hits 2456 3294 +838
- Misses 1471 2423 +952
- Partials 134 194 +60
| Impacted Files | Coverage Δ | |
|---|---|---|
| kubectl-volsync/cmd/common_utils.go | 0.0% <0.0%> (ø) |
|
| kubectl-volsync/cmd/replication_schedule.go | 11.1% <0.0%> (ø) |
|
| kubectl-volsync/cmd/replication_sync.go | 5.0% <0.0%> (+1.2%) |
:arrow_up: |
| kubectl-volsync/cmd/pvbackup_delete.go | 4.1% <4.1%> (ø) |
|
| kubectl-volsync/cmd/pvbackup.go | 5.7% <5.7%> (ø) |
|
| kubectl-volsync/cmd/pvbackup_create.go | 6.2% <6.2%> (ø) |
|
| kubectl-volsync/cmd/pvbackup_restore.go | 7.6% <7.6%> (ø) |
|
| kubectl-volsync/cmd/pvbackup_sync.go | 8.6% <8.6%> (ø) |
|
| kubectl-volsync/cmd/pvbackup_schedule.go | 11.7% <11.7%> (ø) |
|
| controllers/utils/affinity.go | 86.6% <100.0%> (-2.3%) |
:arrow_down: |
| ... and 16 more |
/retest
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: v-harihar
Once this PR has been reviewed and has the lgtm label, please assign johnstrunk for approval by writing /assign @johnstrunk in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
4 Code Smells
No Coverage information
2.1% Duplication
@v-harihar: The following test 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/e2e-openshift | 0cfaeff8fbe5287b769aba5bbb3923efe6674241 | link | false | /test e2e-openshift |
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/test-infra repository. I understand the commands that are listed here.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
This pull request has been automatically closed due to inactivity. Please re-open if these changes are still required.
/unstale