@@ -111,6 +111,7 @@ func TestOperatorGroup(t *testing.T) {
111
111
// (Verify that the operator can operate in the target namespace)
112
112
// Update CSV to support no InstallModes
113
113
// Verify the CSV transitions to FAILED
114
+ // Verify the copied CSV transitions to FAILED
114
115
// Delete CSV
115
116
// Verify copied CVS is deleted
116
117
@@ -401,20 +402,29 @@ func TestOperatorGroup(t *testing.T) {
401
402
require .Equal (t , viewPolicyRules , viewRole .Rules )
402
403
403
404
// Unsupport all InstallModes
405
+ t .Log ("unsupporting all csv installmodes" )
404
406
fetchedCSV , err := crc .OperatorsV1alpha1 ().ClusterServiceVersions (opGroupNamespace ).Get (csvName , metav1.GetOptions {})
405
407
require .NoError (t , err , "could not fetch csv" )
406
408
fetchedCSV .Spec .InstallModes = []v1alpha1.InstallMode {}
407
409
_ , err = crc .OperatorsV1alpha1 ().ClusterServiceVersions (fetchedCSV .GetNamespace ()).Update (fetchedCSV )
408
410
require .NoError (t , err , "could not update csv installmodes" )
411
+
412
+ // Ensure CSV fails
409
413
_ , err = fetchCSV (t , crc , csvName , opGroupNamespace , csvFailedChecker )
410
414
require .NoError (t , err , "csv did not transition to failed as expected" )
411
415
416
+ // Ensure Failed status was propagated to copied CSV
417
+ _ , err = fetchCSV (t , crc , csvName , otherNamespaceName , func (csv * v1alpha1.ClusterServiceVersion ) bool {
418
+ return csvFailedChecker (csv ) && csv .Status .Reason == v1alpha1 .CSVReasonCopied
419
+ })
420
+ require .NoError (t , err , "csv failed status did not propagate to copied csv" )
421
+
412
422
// ensure deletion cleans up copied CSV
413
- t .Log ("Deleting CSV " )
423
+ t .Log ("deleting parent csv " )
414
424
err = crc .OperatorsV1alpha1 ().ClusterServiceVersions (opGroupNamespace ).Delete (csvName , & metav1.DeleteOptions {})
415
425
require .NoError (t , err )
416
426
417
- t .Log ("Waiting for orphaned CSV to be deleted" )
427
+ t .Log ("waiting for orphaned csv to be deleted" )
418
428
err = waitForDelete (func () error {
419
429
_ , err = crc .OperatorsV1alpha1 ().ClusterServiceVersions (otherNamespaceName ).Get (csvName , metav1.GetOptions {})
420
430
return err
0 commit comments