chore: refactor operations API to use selectors

This commit is contained in:
garethgeorge
2024-05-18 18:39:42 -07:00
parent 1a3ace9014
commit c83d080391
29 changed files with 2969 additions and 3793 deletions

View File

@@ -9,9 +9,9 @@ import (
)
// FlowIDForSnapshotID returns the flow ID associated with the backup task that created snapshot ID or 0 if not found.
func FlowIDForSnapshotID(oplog *oplog.OpLog, snapshotID string) (int64, error) {
func FlowIDForSnapshotID(log *oplog.OpLog, snapshotID string) (int64, error) {
var flowID int64
if err := oplog.ForEachBySnapshotId(snapshotID, indexutil.CollectAll(), func(op *v1.Operation) error {
if err := log.ForEach(oplog.Query{SnapshotId: snapshotID}, indexutil.CollectAll(), func(op *v1.Operation) error {
if _, ok := op.Op.(*v1.Operation_OperationBackup); !ok {
return nil
}