@@ -99,8 +99,6 @@ func TestNamespaceResolver(t *testing.T) {
99
99
},
100
100
},
101
101
{
102
- << << << < HEAD
103
- == == == =
104
102
name : "SingleNewSubscription/ResolveOne/BundlePath" ,
105
103
clusterState : []runtime.Object {
106
104
newSub (namespace , "a" , "alpha" , catalog ),
@@ -132,7 +130,6 @@ func TestNamespaceResolver(t *testing.T) {
132
130
},
133
131
},
134
132
{
135
- >> >> >> > fa4b13b9 ... Fix Operator Generation code
136
133
name : "SingleNewSubscription/ResolveOne/AdditionalBundleObjects" ,
137
134
clusterState : []runtime.Object {
138
135
newSub (namespace , "a" , "alpha" , catalog ),
@@ -223,8 +220,6 @@ func TestNamespaceResolver(t *testing.T) {
223
220
},
224
221
},
225
222
{
226
- << << << < HEAD
227
- == == == =
228
223
name : "InstalledSub/UpdateAvailable/FromBundlePath" ,
229
224
clusterState : []runtime.Object {
230
225
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
@@ -250,7 +245,6 @@ func TestNamespaceResolver(t *testing.T) {
250
245
},
251
246
},
252
247
{
253
- >> >> >> > fa4b13b9 ... Fix Operator Generation code
254
248
name : "InstalledSub/NoRunningOperator" ,
255
249
clusterState : []runtime.Object {
256
250
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
@@ -411,6 +405,55 @@ func TestNamespaceResolver(t *testing.T) {
411
405
},
412
406
},
413
407
},
408
+ {
409
+ // This test verifies that ownership of an api can be migrated between two operators
410
+ name : "OwnedAPITransfer" ,
411
+ clusterState : []runtime.Object {
412
+ existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
413
+ existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
414
+ existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
415
+ existingOperator (namespace , "b.v1" , "b" , "alpha" , "" , nil , Requires1 , nil , nil ),
416
+ },
417
+ querier : NewFakeSourceQuerier (map [CatalogKey ][]* api.Bundle {
418
+ catalog : {
419
+ bundle ("a.v2" , "a" , "alpha" , "a.v1" , nil , nil , nil , nil ),
420
+ bundle ("b.v2" , "b" , "alpha" , "b.v1" , Provides1 , nil , nil , nil ),
421
+ },
422
+ }),
423
+ out : out {
424
+ steps : [][]* v1alpha1.Step {
425
+ bundleSteps (bundle ("a.v2" , "a" , "alpha" , "a.v1" , nil , nil , nil , nil ), namespace , "" , catalog ),
426
+ bundleSteps (bundle ("b.v2" , "b" , "alpha" , "b.v1" , Provides1 , nil , nil , nil ), namespace , "" , catalog ),
427
+ },
428
+ subs : []* v1alpha1.Subscription {
429
+ updatedSub (namespace , "a.v2" , "a" , "alpha" , catalog ),
430
+ updatedSub (namespace , "b.v2" , "b" , "alpha" , catalog ),
431
+ },
432
+ },
433
+ },
434
+ {
435
+ name : "PicksOlderProvider" ,
436
+ clusterState : []runtime.Object {
437
+ newSub (namespace , "b" , "alpha" , catalog ),
438
+ },
439
+ querier : NewFakeSourceQuerier (map [CatalogKey ][]* api.Bundle {
440
+ catalog : {
441
+ bundle ("a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
442
+ bundle ("a.v2" , "a" , "alpha" , "a.v1" , nil , nil , nil , nil ),
443
+ bundle ("b.v1" , "b" , "alpha" , "" , nil , Requires1 , nil , nil ),
444
+ },
445
+ }),
446
+ out : out {
447
+ steps : [][]* v1alpha1.Step {
448
+ bundleSteps (bundle ("a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ), namespace , "" , catalog ),
449
+ bundleSteps (bundle ("b.v1" , "b" , "alpha" , "" , nil , Requires1 , nil , nil ), namespace , "" , catalog ),
450
+ subSteps (namespace , "a.v1" , "a" , "alpha" , catalog ),
451
+ },
452
+ subs : []* v1alpha1.Subscription {
453
+ updatedSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
454
+ },
455
+ },
456
+ },
414
457
{
415
458
name : "InstalledSub/UpdateInHead/SkipRange" ,
416
459
clusterState : []runtime.Object {
0 commit comments