forked from mtusi2026/mtusi2026lab4
fix: preserve reconciliation dry runs
This commit is contained in:
@@ -227,6 +227,7 @@ func (r *Reconciler) handleMissingObject(
|
||||
) error {
|
||||
report.MetadataScanned++
|
||||
if metadata.Status == model.AttachmentDeleting {
|
||||
report.DeletingAttachments++
|
||||
return r.deleteClaimedMetadata(ctx, metadata, report)
|
||||
}
|
||||
if metadata.CreatedAt.After(cutoff) {
|
||||
@@ -252,6 +253,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)
|
||||
|
||||
Reference in New Issue
Block a user