-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Check restore Phase before downloading logs #496
Conversation
Is this a reasonable fix? I added the logic to the |
pkg/cmd/cli/restore/logs.go
Outdated
return err | ||
} | ||
if r.Status.Phase != v1.RestorePhaseCompleted { | ||
err = errors.Errorf("Restore %s is not yet complete.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say "unable to retrieve logs because restore is not yet complete." I don't think we need to include the name of the restore.
@nrb yes, this is reasonable, thanks. |
db214fe
to
257262f
Compare
pkg/cmd/cli/restore/logs.go
Outdated
return err | ||
} | ||
if r.Status.Phase != v1.RestorePhaseCompleted { | ||
err = errors.Errorf("unable to retrieve logs because restore is not complete") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors.New(...)
since it's not a format string, and I'd probably just return the error here and change L93 to a return nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to returning here
I'm almost always in favor of Errorf 100% of the time even if there aren't format strings - saves you the time of having to replace New with Errorf if you do decide you need formatted vars
Signed-off-by: Nolan Brubaker <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
LGTM |
Fixes #477
Signed-off-by: Nolan Brubaker [email protected]