Skip to content

Commit 319eeac

Browse files
committed
include backup meta for restore command
1 parent 46e9ba2 commit 319eeac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cmd/pbm/diagnostic.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@ func handleDiagnostic(
104104
return nil, errors.Wrapf(err,
105105
"failed to save %s", filepath.Join(opts.path, prefix+".restore.json"))
106106
}
107+
108+
meta, err := pbm.GetBackupByName(ctx, meta.Backup, sdk.GetBackupByNameOptions{})
109+
if err != nil {
110+
if !errors.Is(err, sdk.ErrNotFound) {
111+
return nil, errors.Wrap(err, "get backup meta")
112+
}
113+
} else {
114+
meta.Store = backup.Storage{}
115+
err = writeToFile(opts.path, prefix+".backup.json", meta)
116+
if err != nil {
117+
return nil, errors.Wrapf(err,
118+
"failed to save %s", filepath.Join(opts.path, prefix+".backup.json"))
119+
}
120+
}
107121
}
108122
}
109123

0 commit comments

Comments
 (0)