@@ -52,27 +52,6 @@ func TestClient(t *testing.T) {
52
52
fetcher : & MockFetcher {shouldError : true },
53
53
wantErr : "error fetching catalog contents: mock cache error" ,
54
54
},
55
- {
56
- name : "channel has a ref to a missing bundle" ,
57
- fakeCatalog : func () ([]client.Object , []* catalogmetadata.Bundle , map [string ][]byte ) {
58
- objs , _ , catalogContentMap := defaultFakeCatalog ()
59
-
60
- catalogContentMap ["catalog-1" ] = append (catalogContentMap ["catalog-1" ], []byte (`{
61
- "schema": "olm.channel",
62
- "name": "channel-with-missing-bundle",
63
- "package": "fake1",
64
- "entries": [
65
- {
66
- "name": "fake1.v9.9.9"
67
- }
68
- ]
69
- }` )... )
70
-
71
- return objs , nil , catalogContentMap
72
- },
73
- wantErr : `bundle "fake1.v9.9.9" not found in catalog "catalog-1" (package "fake1", channel "channel-with-missing-bundle")` ,
74
- fetcher : & MockFetcher {},
75
- },
76
55
{
77
56
name : "invalid meta" ,
78
57
fakeCatalog : func () ([]client.Object , []* catalogmetadata.Bundle , map [string ][]byte ) {
@@ -132,10 +111,10 @@ func TestClient(t *testing.T) {
132
111
objs , bundles , catalogContentMap := defaultFakeCatalog ()
133
112
134
113
catalogContentMap ["catalog-1" ] = append (catalogContentMap ["catalog-1" ],
135
- []byte (`{"schema": "olm.deprecations", "package":"fake1", "entries":[{"message": "fake1 is deprecated", "reference": {"schema": "olm.package"}}, {"message":"channel stable is deprecated", "reference": {"schema": "olm.channel", "name": "stable"}}, {"message": " bundle fake1.v1.0.0 is deprecated", "reference":{"schema":"olm.bundle", "name":"fake1.v1.0.0"}}]}` )... )
114
+ []byte (`{"schema": "olm.deprecations", "package":"fake1", "entries":[{"message": "bundle fake1.v1.0.0 is deprecated", "reference":{"schema":"olm.bundle", "name":"fake1.v1.0.0"}}]}` )... )
136
115
137
116
for i := range bundles {
138
- if bundles [i ].Name == "fake1.v1.0.0" {
117
+ if bundles [i ].Name == "fake1.v1.0.0" && bundles [ i ]. Catalog == "catalog-1" {
139
118
bundles [i ].Deprecation = & declcfg.DeprecationEntry {
140
119
Reference : declcfg.PackageScopedReference {
141
120
Schema : "olm.bundle" ,
@@ -161,10 +140,10 @@ func TestClient(t *testing.T) {
161
140
tt .fetcher ,
162
141
)
163
142
164
- bundles , err := fakeCatalogClient .CatalogContents (ctx )
143
+ contents , err := fakeCatalogClient .CatalogContents (ctx )
165
144
if tt .wantErr == "" {
166
145
assert .NoError (t , err )
167
- assert .Equal (t , expectedBundles , bundles )
146
+ assert .Equal (t , expectedBundles , contents . Bundles )
168
147
} else {
169
148
assert .EqualError (t , err , tt .wantErr )
170
149
}
0 commit comments