Skip to content

Commit ca53411

Browse files
committed
remove strategy.legacy layer from olm.channel schema
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1 parent 00cb8d4 commit ca53411

File tree

16 files changed

+381
-489
lines changed

16 files changed

+381
-489
lines changed

alpha/action/render_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ func TestRender(t *testing.T) {
7676
},
7777
},
7878
Channels: []declcfg.Channel{
79-
{Schema: "olm.channel", Package: "foo", Name: "beta", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
79+
{Schema: "olm.channel", Package: "foo", Name: "beta", Entries: []declcfg.ChannelEntry{
8080
{Name: "foo.v0.1.0", SkipRange: "<0.1.0"},
8181
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
82-
}}}},
83-
{Schema: "olm.channel", Package: "foo", Name: "stable", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
82+
}},
83+
{Schema: "olm.channel", Package: "foo", Name: "stable", Entries: []declcfg.ChannelEntry{
8484
{Name: "foo.v0.1.0", SkipRange: "<0.1.0"},
8585
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
86-
}}}},
86+
}},
8787
},
8888
Bundles: []declcfg.Bundle{
8989
{
@@ -168,14 +168,14 @@ func TestRender(t *testing.T) {
168168
},
169169
},
170170
Channels: []declcfg.Channel{
171-
{Schema: "olm.channel", Package: "foo", Name: "beta", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
171+
{Schema: "olm.channel", Package: "foo", Name: "beta", Entries: []declcfg.ChannelEntry{
172172
{Name: "foo.v0.1.0", SkipRange: "<0.1.0"},
173173
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
174-
}}}},
175-
{Schema: "olm.channel", Package: "foo", Name: "stable", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
174+
}},
175+
{Schema: "olm.channel", Package: "foo", Name: "stable", Entries: []declcfg.ChannelEntry{
176176
{Name: "foo.v0.1.0", SkipRange: "<0.1.0"},
177177
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
178-
}}}},
178+
}},
179179
},
180180
Bundles: []declcfg.Bundle{
181181
{
@@ -260,13 +260,13 @@ func TestRender(t *testing.T) {
260260
},
261261
},
262262
Channels: []declcfg.Channel{
263-
{Schema: "olm.channel", Package: "foo", Name: "beta", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
263+
{Schema: "olm.channel", Package: "foo", Name: "beta", Entries: []declcfg.ChannelEntry{
264264
{Name: "foo.v0.1.0", SkipRange: "<0.1.0"},
265265
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
266-
}}}},
267-
{Schema: "olm.channel", Package: "foo", Name: "stable", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
266+
}},
267+
{Schema: "olm.channel", Package: "foo", Name: "stable", Entries: []declcfg.ChannelEntry{
268268
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
269-
}}}},
269+
}},
270270
},
271271
Bundles: []declcfg.Bundle{
272272
{
@@ -351,13 +351,13 @@ func TestRender(t *testing.T) {
351351
},
352352
},
353353
Channels: []declcfg.Channel{
354-
{Schema: "olm.channel", Package: "foo", Name: "beta", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
354+
{Schema: "olm.channel", Package: "foo", Name: "beta", Entries: []declcfg.ChannelEntry{
355355
{Name: "foo.v0.1.0", SkipRange: "<0.1.0"},
356356
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
357-
}}}},
358-
{Schema: "olm.channel", Package: "foo", Name: "stable", Strategy: declcfg.ChannelStrategy{Legacy: &declcfg.LegacyChannelStrategy{Entries: []declcfg.LegacyChannelEntry{
357+
}},
358+
{Schema: "olm.channel", Package: "foo", Name: "stable", Entries: []declcfg.ChannelEntry{
359359
{Name: "foo.v0.2.0", Replaces: "foo.v0.1.0", SkipRange: "<0.2.0", Skips: []string{"foo.v0.1.1", "foo.v0.1.2"}},
360-
}}}},
360+
}},
361361
},
362362
Bundles: []declcfg.Bundle{
363363
{

alpha/action/testdata/foo-index-v0.2.0-declcfg/foo/index.yaml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,26 @@ defaultChannel: beta
66
schema: olm.channel
77
package: foo
88
name: beta
9-
strategy:
10-
legacy:
11-
entries:
12-
- name: foo.v0.1.0
13-
skipRange: <0.1.0
14-
- name: foo.v0.2.0
15-
replaces: foo.v0.1.0
16-
skipRange: <0.2.0
17-
skips:
18-
- foo.v0.1.1
19-
- foo.v0.1.2
9+
entries:
10+
- name: foo.v0.1.0
11+
skipRange: <0.1.0
12+
- name: foo.v0.2.0
13+
replaces: foo.v0.1.0
14+
skipRange: <0.2.0
15+
skips:
16+
- foo.v0.1.1
17+
- foo.v0.1.2
2018
---
2119
schema: olm.channel
2220
package: foo
2321
name: stable
24-
strategy:
25-
legacy:
26-
entries:
27-
- name: foo.v0.2.0
28-
replaces: foo.v0.1.0
29-
skipRange: <0.2.0
30-
skips:
31-
- foo.v0.1.1
32-
- foo.v0.1.2
33-
22+
entries:
23+
- name: foo.v0.2.0
24+
replaces: foo.v0.1.0
25+
skipRange: <0.2.0
26+
skips:
27+
- foo.v0.1.1
28+
- foo.v0.1.2
3429
---
3530
schema: olm.bundle
3631
package: foo

alpha/action/testdata/index-declcfgs/exp-headsonly/index.yaml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,19 @@ schema: olm.package
66
name: alpha
77
package: bar
88
schema: olm.channel
9-
strategy:
10-
legacy:
11-
entries:
12-
- name: bar.v0.1.0
13-
- name: bar.v0.2.0
14-
skips:
15-
- bar.v0.1.0
16-
- name: bar.v1.0.0
17-
replaces: bar.v0.2.0
9+
entries:
10+
- name: bar.v0.1.0
11+
- name: bar.v0.2.0
12+
skips:
13+
- bar.v0.1.0
14+
- name: bar.v1.0.0
15+
replaces: bar.v0.2.0
1816
---
1917
name: stable
2018
package: bar
2119
schema: olm.channel
22-
strategy:
23-
legacy:
24-
entries:
25-
- name: bar.v1.0.0
20+
entries:
21+
- name: bar.v1.0.0
2622
---
2723
# Added because foo.v0.3.1 depends on bar <0.2.0
2824
image: test.registry/bar-operator/bar-bundle:v0.1.0
@@ -112,13 +108,11 @@ schema: olm.package
112108
name: stable
113109
package: baz
114110
schema: olm.channel
115-
strategy:
116-
legacy:
117-
entries:
118-
- name: baz.v1.1.0
119-
replaces: baz.v1.0.0
120-
skips:
121-
- baz.v1.0.1
111+
entries:
112+
- name: baz.v1.1.0
113+
replaces: baz.v1.0.0
114+
skips:
115+
- baz.v1.0.1
122116
---
123117
image: test.registry/baz-operator/baz-bundle:v1.1.0
124118
name: baz.v1.1.0
@@ -151,13 +145,11 @@ schema: olm.package
151145
name: beta
152146
package: foo
153147
schema: olm.channel
154-
strategy:
155-
legacy:
156-
entries:
157-
- name: foo.v0.3.1
158-
replaces: foo.v0.2.0
159-
skips:
160-
- foo.v0.3.0
148+
entries:
149+
- name: foo.v0.3.1
150+
replaces: foo.v0.2.0
151+
skips:
152+
- foo.v0.3.0
161153
---
162154
image: test.registry/foo-operator/foo-bundle:v0.3.1
163155
name: foo.v0.3.1
@@ -190,6 +182,7 @@ properties:
190182
version: 0.3.1
191183
- type: olm.package.required
192184
value:
185+
packageName: bar
193186
packageName: bar
194187
versionRange: <0.2.0
195188
relatedImages:

alpha/action/testdata/index-declcfgs/exp-latest/index.yaml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ schema: olm.package
66
name: alpha
77
package: bar
88
schema: olm.channel
9-
strategy:
10-
legacy:
11-
entries:
12-
- name: bar.v1.0.0
13-
replaces: bar.v0.2.0
9+
entries:
10+
- name: bar.v1.0.0
11+
replaces: bar.v0.2.0
1412
---
1513
name: stable
1614
package: bar
1715
schema: olm.channel
18-
strategy:
19-
legacy:
20-
entries:
21-
- name: bar.v1.0.0
16+
entries:
17+
- name: bar.v1.0.0
2218
---
2319
image: test.registry/bar-operator/bar-bundle:v1.0.0
2420
name: bar.v1.0.0
@@ -56,13 +52,11 @@ schema: olm.package
5652
name: stable
5753
package: baz
5854
schema: olm.channel
59-
strategy:
60-
legacy:
61-
entries:
62-
- name: baz.v1.1.0
63-
replaces: baz.v1.0.0
64-
skips:
65-
- baz.v1.0.1
55+
entries:
56+
- name: baz.v1.1.0
57+
replaces: baz.v1.0.0
58+
skips:
59+
- baz.v1.0.1
6660
---
6761
image: test.registry/baz-operator/baz-bundle:v1.1.0
6862
name: baz.v1.1.0
@@ -95,13 +89,11 @@ schema: olm.package
9589
name: beta
9690
package: foo
9791
schema: olm.channel
98-
strategy:
99-
legacy:
100-
entries:
101-
- name: foo.v0.3.1
102-
replaces: foo.v0.2.0
103-
skips:
104-
- foo.v0.3.0
92+
entries:
93+
- name: foo.v0.3.1
94+
replaces: foo.v0.2.0
95+
skips:
96+
- foo.v0.3.0
10597
---
10698
image: test.registry/foo-operator/foo-bundle:v0.3.1
10799
name: foo.v0.3.1

alpha/action/testdata/index-declcfgs/latest/index.yaml

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,20 @@ schema: olm.package
66
name: alpha
77
package: bar
88
schema: olm.channel
9-
strategy:
10-
legacy:
11-
entries:
12-
- name: bar.v0.1.0
13-
- name: bar.v0.2.0
14-
skipRange: <0.2.0
15-
skips:
16-
- bar.v0.1.0
17-
- name: bar.v1.0.0
18-
replaces: bar.v0.2.0
9+
entries:
10+
- name: bar.v0.1.0
11+
- name: bar.v0.2.0
12+
skipRange: <0.2.0
13+
skips:
14+
- bar.v0.1.0
15+
- name: bar.v1.0.0
16+
replaces: bar.v0.2.0
1917
---
2018
name: stable
2119
package: bar
2220
schema: olm.channel
23-
strategy:
24-
legacy:
25-
entries:
26-
- name: bar.v1.0.0
21+
entries:
22+
- name: bar.v1.0.0
2723
---
2824
image: test.registry/bar-operator/bar-bundle:v0.1.0
2925
name: bar.v0.1.0
@@ -109,20 +105,18 @@ schema: olm.package
109105
schema: olm.channel
110106
package: baz
111107
name: stable
112-
strategy:
113-
legacy:
114-
entries:
115-
- name: baz.v1.0.0
116-
skipRange: <1.0.0
117-
- name: baz.v1.0.1
118-
replaces: baz.v1.0.0
119-
skipRange: <1.0.0
120-
skips:
121-
- baz.v1.0.0
122-
- name: baz.v1.1.0
123-
replaces: baz.v1.0.0
124-
skips:
125-
- baz.v1.0.1
108+
entries:
109+
- name: baz.v1.0.0
110+
skipRange: <1.0.0
111+
- name: baz.v1.0.1
112+
replaces: baz.v1.0.0
113+
skipRange: <1.0.0
114+
skips:
115+
- baz.v1.0.0
116+
- name: baz.v1.1.0
117+
replaces: baz.v1.0.0
118+
skips:
119+
- baz.v1.0.1
126120
---
127121
image: test.registry/baz-operator/baz-bundle:v1.0.0
128122
name: baz.v1.0.0
@@ -203,23 +197,21 @@ schema: olm.package
203197
schema: olm.channel
204198
package: foo
205199
name: beta
206-
strategy:
207-
legacy:
208-
entries:
209-
- name: foo.v0.1.0
210-
skipRange: <0.1.0
211-
- name: foo.v0.2.0
212-
replaces: foo.v0.1.0
213-
skipRange: <0.2.0
214-
skips:
215-
- foo.v0.1.1
216-
- foo.v0.1.2
217-
- name: foo.v0.3.0
218-
replaces: foo.v0.2.0
219-
- name: foo.v0.3.1
220-
replaces: foo.v0.2.0
221-
skips:
222-
- foo.v0.3.0
200+
entries:
201+
- name: foo.v0.1.0
202+
skipRange: <0.1.0
203+
- name: foo.v0.2.0
204+
replaces: foo.v0.1.0
205+
skipRange: <0.2.0
206+
skips:
207+
- foo.v0.1.1
208+
- foo.v0.1.2
209+
- name: foo.v0.3.0
210+
replaces: foo.v0.2.0
211+
- name: foo.v0.3.1
212+
replaces: foo.v0.2.0
213+
skips:
214+
- foo.v0.3.0
223215
---
224216
image: test.registry/foo-operator/foo-bundle:v0.1.0
225217
name: foo.v0.1.0

0 commit comments

Comments
 (0)