Skip to content

Commit d3be374

Browse files
committed
clarify pruned bundle message
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
1 parent 37551d4 commit d3be374

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/lib/registry/registry.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ func checkForBundles(ctx context.Context, q *sqlite.SQLQuerier, g registry.Graph
425425
errs = append(errs, fmt.Errorf("could not validate pruned bundle %s (%s) as deprecated: %v", bundle.CsvName, bundle.BundlePath, err))
426426
}
427427
if !deprecated {
428-
errs = append(errs, fmt.Errorf("added bundle %s pruned from package %s, channel %s: this may be due to incorrect channel head (%s)", bundle.BundlePath, pkg.Name, channel, graph.Channels[channel].Head.CsvName))
428+
headSkips := []string{}
429+
for b := range graph.Channels[channel].Nodes[graph.Channels[channel].Head] {
430+
headSkips = append(headSkips, b.CsvName)
431+
}
432+
errs = append(errs, fmt.Errorf("add prunes bundle %s (%s, %s) from package %s, channel %s: this may be due to incorrect channel head (%s, skips/replaces %v)", bundle.CsvName, bundle.Version, bundle.BundlePath, pkg.Name, channel, graph.Channels[channel].Head.CsvName, headSkips))
429433
}
430434
}
431435
}

pkg/lib/registry/registry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func TestCheckForBundles(t *testing.T) {
444444
},
445445
},
446446
},
447-
wantErr: fmt.Errorf("added bundle unorderedReplaces-1.0.0 pruned from package testpkg, channel stable: this may be due to incorrect channel head (unorderedReplaces-1.1.0)"),
447+
wantErr: fmt.Errorf("add prunes bundle unorderedReplaces-1.0.0 (1.0.0, unorderedReplaces-1.0.0) from package testpkg, channel stable: this may be due to incorrect channel head (unorderedReplaces-1.1.0, skips/replaces [])"),
448448
},
449449
{
450450
description: "ignoreDeprecated",

0 commit comments

Comments
 (0)