replace FindFilteredSnapshots() with (*data.SnapshotFilter).FindAll() (#21912)

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
This commit is contained in:
Winfried PlappertandMichael Eischer authored and GitHub committed 2026-06-28 13:31:06 +00:00
1 parent 75de8b54e6
commit 62991338ea
9 files changed
+103 -77

No files matched your search

+8 -4
View File
@@ -675,11 +675,15 @@ func runFind(ctx context.Context, opts FindOptions, gopts global.Options, args [
}
var filteredSnapshots []*data.Snapshot
for sn := range FindFilteredSnapshots(ctx, snapshotLister, repo, &opts.SnapshotFilter, opts.Snapshots, printer) {
err = opts.SnapshotFilter.FindAll(ctx, snapshotLister, repo, opts.Snapshots, func(_ string, sn *data.Snapshot, err error) error {
if err != nil {
return err
}
filteredSnapshots = append(filteredSnapshots, sn)
}
if ctx.Err() != nil {
return ctx.Err()
return nil
})
if err != nil {
return err
}
sort.Slice(filteredSnapshots, func(i, j int) bool {