Resolve linter issues.

Signed-off-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
Xun Jiang
2023-11-28 15:23:13 +08:00
parent d70535b6d2
commit f5c159ce56
19 changed files with 31 additions and 22 deletions

View File

@@ -546,7 +546,8 @@ func (r *backupDeletionReconciler) deleteMovedSnapshots(ctx context.Context, bac
snapshot := repository.SnapshotIdentifier{}
b, err := json.Marshal(cm.Data)
if err != nil {
r.logger.WithError(err).Infof("Fail to encode JSON: %v", cm.Data)
errs = append(errs, errors.Wrapf(err, "fail to marshal the snapshot info into JSON"))
continue
}
if err := json.Unmarshal(b, &snapshot); err != nil {
errs = append(errs, errors.Wrapf(err, "failed to unmarshal snapshot info"))