Skip to content

Commit 386e61b

Browse files
committed
Draft: Deprecated inner channel entries cause resolution error.
Signed-off-by: Ben Luddy <[email protected]>
1 parent 6e2db16 commit 386e61b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pkg/controller/registry/resolver/resolver_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,35 @@ func TestSolveOperators_WithoutDeprecated(t *testing.T) {
13621362
assert.IsType(t, solver.NotSatisfiable{}, err)
13631363
}
13641364

1365+
func TestSolveOperatorsWithDeprecatedInnerChannelEntry(t *testing.T) {
1366+
catalog := registry.CatalogKey{Name: "catalog", Namespace: "namespace"}
1367+
1368+
subs := []*v1alpha1.Subscription{
1369+
newSub(catalog.Namespace, "a", "c", catalog),
1370+
}
1371+
logger, _ := test.NewNullLogger()
1372+
resolver := SatResolver{
1373+
cache: getFakeOperatorCache(NamespacedOperatorCache{
1374+
snapshots: map[registry.CatalogKey]*CatalogSnapshot{
1375+
catalog: {
1376+
key: catalog,
1377+
operators: []*Operator{
1378+
genOperator("a-1", "1.0.0", "", "a", "c", catalog.Name, catalog.Namespace, nil, nil, nil, "", false),
1379+
genOperator("a-2", "2.0.0", "a-1", "a", "c", catalog.Name, catalog.Namespace, nil, nil, nil, "", true),
1380+
genOperator("a-3", "3.0.0", "a-2", "a", "c", catalog.Name, catalog.Namespace, nil, nil, nil, "", false),
1381+
},
1382+
},
1383+
},
1384+
}),
1385+
log: logger,
1386+
}
1387+
1388+
operators, err := resolver.SolveOperators([]string{"olm"}, nil, subs)
1389+
assert.NoError(t, err)
1390+
assert.Len(t, operators, 1)
1391+
assert.Contains(t, operators, "a-3")
1392+
}
1393+
13651394
func TestSolveOperators_WithSkipsAndStartingCSV(t *testing.T) {
13661395
APISet := APISet{opregistry.APIKey{"g", "v", "k", "ks"}: struct{}{}}
13671396
Provides := APISet

0 commit comments

Comments
 (0)