@@ -325,6 +325,13 @@ var _ = Describe("OperandRequest controller", func() {
325
325
return err
326
326
}, testutil .Timeout , testutil .Interval ).Should (Succeed ())
327
327
328
+ By ("Checking the status of first OperandRequest" )
329
+ Eventually (func () operatorv1alpha1.ClusterPhase {
330
+ requestInstance1 := & operatorv1alpha1.OperandRequest {}
331
+ Expect (k8sClient .Get (ctx , requestKey1 , requestInstance1 )).Should (Succeed ())
332
+ return requestInstance1 .Status .Phase
333
+ }, testutil .Timeout , testutil .Interval ).Should (Equal (operatorv1alpha1 .ClusterPhaseRunning ))
334
+
328
335
By ("Disabling the jaeger operator from first OperandRequest" )
329
336
requestInstance1 := & operatorv1alpha1.OperandRequest {}
330
337
Expect (k8sClient .Get (ctx , requestKey1 , requestInstance1 )).Should (Succeed ())
@@ -338,6 +345,13 @@ var _ = Describe("OperandRequest controller", func() {
338
345
return err
339
346
}, testutil .Timeout , testutil .Interval ).Should (Succeed ())
340
347
348
+ By ("Checking the status of first OperandRequest after updating the Operand" )
349
+ Eventually (func () operatorv1alpha1.ClusterPhase {
350
+ requestInstance1 := & operatorv1alpha1.OperandRequest {}
351
+ Expect (k8sClient .Get (ctx , requestKey1 , requestInstance1 )).Should (Succeed ())
352
+ return requestInstance1 .Status .Phase
353
+ }, testutil .Timeout , testutil .Interval ).Should (Equal (operatorv1alpha1 .ClusterPhaseRunning ))
354
+
341
355
By ("Disabling the jaeger operator from second OperandRequest" )
342
356
requestInstance2 := & operatorv1alpha1.OperandRequest {}
343
357
Expect (k8sClient .Get (ctx , requestKey2 , requestInstance2 )).Should (Succeed ())
@@ -351,20 +365,7 @@ var _ = Describe("OperandRequest controller", func() {
351
365
return err != nil && errors .IsNotFound (err )
352
366
}, testutil .Timeout , testutil .Interval ).Should (BeTrue ())
353
367
354
- By ("Deleting the first OperandRequest" )
355
- Expect (k8sClient .Delete (ctx , request1 )).Should (Succeed ())
356
-
357
- By ("Checking mongodb operator has not been deleted" )
358
- Eventually (func () error {
359
- mongodbCSV := & olmv1alpha1.ClusterServiceVersion {}
360
- err := k8sClient .Get (ctx , types.NamespacedName {Name : "mongodb-atlas-kubernetes-csv.v0.0.1" , Namespace : operatorNamespaceName }, mongodbCSV )
361
- return err
362
- }, testutil .Timeout , testutil .Interval ).Should (Succeed ())
363
-
364
- By ("Deleting the second OperandRequest" )
365
- Expect (k8sClient .Delete (ctx , request2 )).Should (Succeed ())
366
-
367
- By ("Checking the k8s resource has been deleted" )
368
+ By ("Checking jaeger k8s resource has been deleted" )
368
369
Eventually (func () bool {
369
370
jaegerConfigMap := & corev1.ConfigMap {}
370
371
err := k8sClient .Get (context .TODO (), types.NamespacedName {Name : "jaeger-configmap" , Namespace : registryNamespaceName }, jaegerConfigMap )
@@ -376,13 +377,34 @@ var _ = Describe("OperandRequest controller", func() {
376
377
return err != nil && errors .IsNotFound (err )
377
378
}, testutil .Timeout , testutil .Interval ).Should (BeTrue ())
378
379
379
- By ("Checking operators have been deleted" )
380
+ By ("Checking jaeger operators have been deleted" )
380
381
Eventually (func () bool {
381
382
jaegerCSV := & olmv1alpha1.ClusterServiceVersion {}
382
383
err := k8sClient .Get (ctx , types.NamespacedName {Name : "jaeger-csv.v0.0.1" , Namespace : operatorNamespaceName }, jaegerCSV )
383
384
return err != nil && errors .IsNotFound (err )
384
385
}, testutil .Timeout , testutil .Interval ).Should (BeTrue ())
385
386
387
+ By ("Checking the status of second OperandRequest after updating the Operand" )
388
+ Eventually (func () operatorv1alpha1.ClusterPhase {
389
+ requestInstance2 := & operatorv1alpha1.OperandRequest {}
390
+ Expect (k8sClient .Get (ctx , requestKey2 , requestInstance2 )).Should (Succeed ())
391
+ return requestInstance2 .Status .Phase
392
+ }, testutil .Timeout , testutil .Interval ).Should (Equal (operatorv1alpha1 .ClusterPhaseRunning ))
393
+
394
+ By ("Deleting the first OperandRequest" )
395
+ Expect (k8sClient .Delete (ctx , request1 )).Should (Succeed ())
396
+
397
+ By ("Checking mongodb operator has not been deleted" )
398
+ Eventually (func () error {
399
+ mongodbCSV := & olmv1alpha1.ClusterServiceVersion {}
400
+ err := k8sClient .Get (ctx , types.NamespacedName {Name : "mongodb-atlas-kubernetes-csv.v0.0.1" , Namespace : operatorNamespaceName }, mongodbCSV )
401
+ return err
402
+ }, testutil .Timeout , testutil .Interval ).Should (Succeed ())
403
+
404
+ By ("Deleting the second OperandRequest" )
405
+ Expect (k8sClient .Delete (ctx , request2 )).Should (Succeed ())
406
+
407
+ By ("Checking the mongodb-atlas operator has been deleted" )
386
408
Eventually (func () bool {
387
409
mongodbCSV := & olmv1alpha1.ClusterServiceVersion {}
388
410
err := k8sClient .Get (ctx , types.NamespacedName {Name : "mongodb-atlas-kubernetes-csv.v0.0.1" , Namespace : operatorNamespaceName }, mongodbCSV )
0 commit comments