diff --git a/cmd/dump.go b/cmd/dump.go index 24205ab..7cef3c3 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -188,7 +188,7 @@ func dumpCmd(passedExecs execs, cmdConfig *cmdConfiguration) (*cobra.Command, er return fmt.Errorf("error running dump: %w", err) } if retention != "" { - if err := executor.Prune(tracerCtx, core.PruneOptions{Targets: targets, Retention: retention}); err != nil { + if err := executor.Prune(tracerCtx, core.PruneOptions{Targets: targets, Retention: retention, Run: uid}); err != nil { dumpSpan.SetStatus(codes.Error, fmt.Sprintf("error running prune: %v", err)) return fmt.Errorf("error running prune: %w", err) } diff --git a/cmd/dump_test.go b/cmd/dump_test.go index 8b885f9..0be5ce6 100644 --- a/cmd/dump_test.go +++ b/cmd/dump_test.go @@ -172,11 +172,10 @@ func TestDumpCmd(t *testing.T) { })).Return(nil) if tt.expectedPruneOptions != nil { m.On("Prune", mock.MatchedBy(func(pruneOpts core.PruneOptions) bool { - diff := deep.Equal(pruneOpts, *tt.expectedPruneOptions) - if diff == nil { + if equalIgnoreFields(pruneOpts, *tt.expectedPruneOptions, []string{"Run"}) { return true } - t.Errorf("pruneOpts compare failed: %v", diff) + t.Errorf("pruneOpts compare failed: %#v %#v", pruneOpts, tt.expectedPruneOptions) return false })).Return(nil) } diff --git a/pkg/core/prune.go b/pkg/core/prune.go index 2cc1506..a67f1e8 100644 --- a/pkg/core/prune.go +++ b/pkg/core/prune.go @@ -61,7 +61,7 @@ func pruneTarget(ctx context.Context, logger *logrus.Entry, target storage.Stora ctx, span := util.GetTracerFromContext(ctx).Start(ctx, fmt.Sprintf("pruneTarget %s", target.URL())) defer span.End() - logger.Debugf("pruning target %s", target) + logger.Debugf("pruning target %s", target.URL()) files, err := target.ReadDir(ctx, ".", logger) if err != nil { span.SetStatus(codes.Error, fmt.Sprintf("failed to read directory: %v", err))