Insert all restore errors and warnings into restore log (#4743)
This allows a user inspecting the restore logs to see any errors or warnings generated by the restore so that they will be seen even without having to use the describe cli. Signed-off-by: Scott Seago <sseago@redhat.com>pull/4762/head
parent
0e0d42b5f2
commit
09ec3ba994
|
@ -0,0 +1 @@
|
|||
Insert all restore errors and warnings into restore log.
|
|
@ -486,6 +486,30 @@ func (c *restoreController) runValidatedRestore(restore *api.Restore, info backu
|
|||
}
|
||||
restoreWarnings, restoreErrors := c.restorer.RestoreWithResolvers(restoreReq, actionsResolver, snapshotItemResolver,
|
||||
c.snapshotLocationLister, pluginManager)
|
||||
|
||||
// log errors and warnings to the restore log
|
||||
for _, msg := range restoreErrors.Velero {
|
||||
restoreLog.Errorf("Velero restore error: %v", msg)
|
||||
}
|
||||
for _, msg := range restoreErrors.Cluster {
|
||||
restoreLog.Errorf("Cluster resource restore error: %v", msg)
|
||||
}
|
||||
for ns, errs := range restoreErrors.Namespaces {
|
||||
for _, msg := range errs {
|
||||
restoreLog.Errorf("Namespace %v, resource restore error: %v", ns, msg)
|
||||
}
|
||||
}
|
||||
for _, msg := range restoreWarnings.Velero {
|
||||
restoreLog.Warnf("Velero restore warning: %v", msg)
|
||||
}
|
||||
for _, msg := range restoreWarnings.Cluster {
|
||||
restoreLog.Warnf("Cluster resource restore warning: %v", msg)
|
||||
}
|
||||
for ns, errs := range restoreWarnings.Namespaces {
|
||||
for _, msg := range errs {
|
||||
restoreLog.Warnf("Namespace %v, resource restore warning: %v", ns, msg)
|
||||
}
|
||||
}
|
||||
restoreLog.Info("restore completed")
|
||||
|
||||
// re-instantiate the backup store because credentials could have changed since the original
|
||||
|
|
Loading…
Reference in New Issue