@@ -20,8 +20,18 @@ import (
20
20
)
21
21
22
22
func TestInstalledPackageVariableSource (t * testing.T ) {
23
- channel := catalogmetadata.Channel {Channel : declcfg.Channel {
24
- Name : "stable" ,
23
+ someOtherPackageChannel := catalogmetadata.Channel {Channel : declcfg.Channel {
24
+ Name : "stable" ,
25
+ Package : "some-other-package" ,
26
+ Entries : []declcfg.ChannelEntry {
27
+ {
28
+ Name : "some-other-package.v2.3.0" ,
29
+ },
30
+ },
31
+ }}
32
+ testPackageChannel := catalogmetadata.Channel {Channel : declcfg.Channel {
33
+ Name : "stable" ,
34
+ Package : "test-package" ,
25
35
Entries : []declcfg.ChannelEntry {
26
36
{
27
37
Name : "test-package.v0.0.1" ,
@@ -80,7 +90,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
80
90
Properties : []property.Property {
81
91
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "0.0.1"}` )},
82
92
}},
83
- InChannels : []* catalogmetadata.Channel {& channel },
93
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
84
94
},
85
95
{Bundle : declcfg.Bundle {
86
96
Name : "test-package.v0.0.2" ,
@@ -89,7 +99,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
89
99
Properties : []property.Property {
90
100
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "0.0.2"}` )},
91
101
}},
92
- InChannels : []* catalogmetadata.Channel {& channel },
102
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
93
103
},
94
104
{Bundle : declcfg.Bundle {
95
105
Name : "test-package.v0.1.0" ,
@@ -98,7 +108,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
98
108
Properties : []property.Property {
99
109
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "0.1.0"}` )},
100
110
}},
101
- InChannels : []* catalogmetadata.Channel {& channel },
111
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
102
112
},
103
113
{Bundle : declcfg.Bundle {
104
114
Name : "test-package.v0.1.1" ,
@@ -107,7 +117,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
107
117
Properties : []property.Property {
108
118
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "0.1.1"}` )},
109
119
}},
110
- InChannels : []* catalogmetadata.Channel {& channel },
120
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
111
121
},
112
122
{Bundle : declcfg.Bundle {
113
123
Name : "test-package.v0.2.0" ,
@@ -116,7 +126,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
116
126
Properties : []property.Property {
117
127
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "0.2.0"}` )},
118
128
}},
119
- InChannels : []* catalogmetadata.Channel {& channel },
129
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
120
130
},
121
131
{Bundle : declcfg.Bundle {
122
132
Name : "test-package.v1.0.0" ,
@@ -125,7 +135,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
125
135
Properties : []property.Property {
126
136
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "1.0.0"}` )},
127
137
}},
128
- InChannels : []* catalogmetadata.Channel {& channel },
138
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
129
139
},
130
140
{Bundle : declcfg.Bundle {
131
141
Name : "test-package.v3.0.0" ,
@@ -134,7 +144,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
134
144
Properties : []property.Property {
135
145
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "3.0.0"}` )},
136
146
}},
137
- InChannels : []* catalogmetadata.Channel {& channel },
147
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
138
148
},
139
149
{Bundle : declcfg.Bundle {
140
150
Name : "test-package.v2.0.0" ,
@@ -143,7 +153,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
143
153
Properties : []property.Property {
144
154
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "2.0.0"}` )},
145
155
}},
146
- InChannels : []* catalogmetadata.Channel {& channel },
156
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
147
157
},
148
158
{Bundle : declcfg.Bundle {
149
159
Name : "test-package.v2.1.0" ,
@@ -152,7 +162,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
152
162
Properties : []property.Property {
153
163
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "2.1.0"}` )},
154
164
}},
155
- InChannels : []* catalogmetadata.Channel {& channel },
165
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
156
166
},
157
167
{Bundle : declcfg.Bundle {
158
168
Name : "test-package.v2.2.0" ,
@@ -161,7 +171,7 @@ func TestInstalledPackageVariableSource(t *testing.T) {
161
171
Properties : []property.Property {
162
172
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "2.2.0"}` )},
163
173
}},
164
- InChannels : []* catalogmetadata.Channel {& channel },
174
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
165
175
},
166
176
{Bundle : declcfg.Bundle {
167
177
Name : "test-package.v4.0.0" ,
@@ -170,16 +180,25 @@ func TestInstalledPackageVariableSource(t *testing.T) {
170
180
Properties : []property.Property {
171
181
{Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "4.0.0"}` )},
172
182
}},
173
- InChannels : []* catalogmetadata.Channel {& channel },
183
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
174
184
},
175
185
{Bundle : declcfg.Bundle {
176
186
Name : "test-package.v5.0.0" ,
177
187
Package : "test-package" ,
178
188
Image :
"registry.io/repo/[email protected] " ,
179
189
Properties : []property.Property {
180
- {Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "5-0.0"}` )},
190
+ {Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "test-package", "version": "5.0.0"}` )},
191
+ }},
192
+ InChannels : []* catalogmetadata.Channel {& testPackageChannel },
193
+ },
194
+ {Bundle : declcfg.Bundle {
195
+ Name : "some-other-package.v2.3.0" ,
196
+ Package : "some-other-package" ,
197
+ Image :
"registry.io/repo/[email protected] " ,
198
+ Properties : []property.Property {
199
+ {Type : property .TypePackage , Value : json .RawMessage (`{"packageName": "some-other-package", "version": "2.3.0"}` )},
181
200
}},
182
- InChannels : []* catalogmetadata.Channel {& channel },
201
+ InChannels : []* catalogmetadata.Channel {& someOtherPackageChannel },
183
202
},
184
203
}
185
204
0 commit comments