Skip to content

Commit c59b8bd

Browse files
committed
fix prune log message; ensure prune gets run UUID
Signed-off-by: Avi Deitcher <avi@deitcher.net>
1 parent b4d743a commit c59b8bd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

cmd/dump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func dumpCmd(passedExecs execs, cmdConfig *cmdConfiguration) (*cobra.Command, er
188188
return fmt.Errorf("error running dump: %w", err)
189189
}
190190
if retention != "" {
191-
if err := executor.Prune(tracerCtx, core.PruneOptions{Targets: targets, Retention: retention}); err != nil {
191+
if err := executor.Prune(tracerCtx, core.PruneOptions{Targets: targets, Retention: retention, Run: uid}); err != nil {
192192
dumpSpan.SetStatus(codes.Error, fmt.Sprintf("error running prune: %v", err))
193193
return fmt.Errorf("error running prune: %w", err)
194194
}

cmd/dump_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,10 @@ func TestDumpCmd(t *testing.T) {
172172
})).Return(nil)
173173
if tt.expectedPruneOptions != nil {
174174
m.On("Prune", mock.MatchedBy(func(pruneOpts core.PruneOptions) bool {
175-
diff := deep.Equal(pruneOpts, *tt.expectedPruneOptions)
176-
if diff == nil {
175+
if equalIgnoreFields(pruneOpts, *tt.expectedPruneOptions, []string{"Run"}) {
177176
return true
178177
}
179-
t.Errorf("pruneOpts compare failed: %v", diff)
178+
t.Errorf("pruneOpts compare failed: %#v %#v", pruneOpts, tt.expectedPruneOptions)
180179
return false
181180
})).Return(nil)
182181
}

pkg/core/prune.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func pruneTarget(ctx context.Context, logger *logrus.Entry, target storage.Stora
6161
ctx, span := util.GetTracerFromContext(ctx).Start(ctx, fmt.Sprintf("pruneTarget %s", target.URL()))
6262
defer span.End()
6363

64-
logger.Debugf("pruning target %s", target)
64+
logger.Debugf("pruning target %s", target.URL())
6565
files, err := target.ReadDir(ctx, ".", logger)
6666
if err != nil {
6767
span.SetStatus(codes.Error, fmt.Sprintf("failed to read directory: %v", err))

0 commit comments

Comments
 (0)