fix: preserve reconciliation dry runs

This commit is contained in:
2026-10-30 14:01:30 +03:00
parent c5b804426e
commit 9ccae0c0c3
2 changed files with 52 additions and 0 deletions
+4
View File
@@ -283,6 +283,7 @@ func (r *Reconciler) handleMissingObject(
return r.deletePair(ctx, metadata, cutoff, report)
}
if metadata.Status == model.AttachmentDeleting {
report.DeletingAttachments++
return r.deleteClaimedMetadata(ctx, metadata, report)
}
if metadata.CreatedAt.After(cutoff) {
@@ -308,6 +309,9 @@ func (r *Reconciler) handleMissingObject(
}
func (r *Reconciler) deleteClaimedMetadata(ctx context.Context, metadata model.Attachment, report *Report) error {
if !r.config.Apply {
return nil
}
deleted, err := r.metadata.DeleteAttachmentIfDeleting(ctx, metadata.ID)
if err != nil {
return fmt.Errorf("delete missing attachment metadata %q: %w", metadata.ID, err)