Velero: In Cluster B allow `--from-schedule` to reference a schedule created in Cluster A

Created on 24 Jan 2019  路  9Comments  路  Source: vmware-tanzu/velero

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

This is not urgent, nor is it super critical. It is just nice to be able to say

ark create from --from-schedule foo-bar

rather than

ark get backups -l ark-schedule=foo-bar | head
ark create --from-backup [COPY_PASTE]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

In the slack channel @nrb said this might be by design. If that is the case this issue can be closed. I don't think it is mission critical by any stretch of the imagination.

Environment:

  • Ark version (use ark version): 0.10.x
Bug EnhancemenUser Good first issue Help wanted

All 9 comments

Adding more context from slack:

$  ark create restore --from-schedule jenkins-main
An error occurred: schedules.ark.heptio.com "jenkins-main" not found

The code in pkg/cmd/cli/restore/create.go tries to get the named schedule and fails if it's not found. I think we can probably remove this check and allow the RestoreController to mark the restore as failed if it can't find any backups matching the requested schedule.

I just checked and the controller already does the check, so we should be able to remove the couple of lines of code from create.go

@ncdc I'd love to take a shot at this. It would be my first non-documentation contribution to an open source project, though. Would I be able to lean on somebody if I have questions?

@mehemken we would love to have your help! Feel free to poke us in #ark-dr in the Kubernetes slack if you need real-time assistance.

I haven't forgotten about this... I plan to get it done this weekend. 馃榾

@skriss @carlisia this still an issue? if yes can i look into?

I believe so, and yes, that'd be great! The approach Andy described sounds reasonable, but let us know if there are any blockers.

@cpanato it looks like right now, the velero restore create command validates that, if you provide a schedule via --from-schedule, the schedule currently exists in the current cluster (see https://github.com/vmware-tanzu/velero/blob/master/pkg/cmd/cli/restore/create.go#L173-L177).

Per Andy's comment, I think it would be safe to remove this validation, and just operate based on label selectors to try to find the most recent backup for the schedule (i.e. https://github.com/vmware-tanzu/velero/blob/master/pkg/cmd/cli/restore/create.go#L228 or https://github.com/vmware-tanzu/velero/blob/master/pkg/controller/restore_controller.go#L319-L341).

This has two benefits: backups created by schedules in different clusters can be restored this way, and also backups created by schedules that no longer exist can be restored.

@skriss thanks for the clarification and input, I saw that but I was unsure if removing that was the correct, because the issue was in the time of ark :) and I did not check the history.

But thanks will work on during the next days

Thanks again for your clarification

Was this page helpful?
0 / 5 - 0 ratings