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

during restore, try to get backup directly from obj storage if not in cache/API #57

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

skriss
Copy link
Member

@skriss skriss commented Aug 25, 2017

… cache/API

Signed-off-by: Steve Kriss steve@heptio.com

Fixes #42

@skriss skriss added this to the v0.4.0 milestone Aug 25, 2017
@skriss skriss changed the title [WIP do not merge] during restore, try to get backup directly from obj storage if not in… during restore, try to get backup directly from obj storage if not in cache/API Aug 29, 2017
@skriss skriss requested a review from ncdc August 29, 2017 19:16
backup, objErr = controller.backupService.GetBackup(bucket, name)
if objErr != nil {
glog.V(4).Infof("Backup %q not found in object storage.", name)
// return the original lister error
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it make more sense to return this error?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, i guess so - was originally thinking that in the case where the user just typo-ed the backup name, the first error might make more sense, but the second is actually fine. minor thing either way.

return nil, err
}

backup.ResourceVersion = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment that we have to clear RV in order to be able to do a create?

backup.ResourceVersion = ""
created, createErr := controller.backupClient.Backups(api.DefaultNamespace).Create(backup)
if createErr != nil {
glog.V(4).Infof("Unable to create API object for backup %q: %v", name, createErr)
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably should be at the error level

name string
backupName string
informerBackups []*api.Backup
backupSvcBackups map[string][]*api.Backup
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to move to mocks instead of fake services, but we don't have to do it as part of this PR

@ncdc
Copy link
Contributor

ncdc commented Sep 5, 2017

LGTM - please squash & we'll merge after jenkins

@skriss
Copy link
Member Author

skriss commented Sep 5, 2017

Argh, gotta fix a test error msg.

… cache/API

Signed-off-by: Steve Kriss <steve@heptio.com>
@ncdc ncdc merged commit 43c74e3 into vmware-tanzu:master Sep 5, 2017
@skriss skriss deleted the restore_missing_backup_fix branch September 5, 2017 17:08
dymurray pushed a commit to dymurray/velero that referenced this pull request May 8, 2020
Added support for restic --verify flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants