@@ -20,6 +20,7 @@ import (
20
20
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
21
21
"k8s.io/apimachinery/pkg/util/wait"
22
22
"k8s.io/apimachinery/pkg/watch"
23
+ "k8s.io/client-go/util/retry"
23
24
"k8s.io/kubernetes/pkg/apis/rbac"
24
25
25
26
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
@@ -1028,13 +1029,16 @@ func TestInstallPlanWithCRDSchemaChange(t *testing.T) {
1028
1029
require .NoError (t , err )
1029
1030
1030
1031
// Update the subscription resource to point to the beta CSV
1031
- subscription , err = fetchSubscription (t , crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
1032
- require .NoError (t , err )
1033
- require .NotNil (t , subscription )
1032
+ err = retry .RetryOnConflict (retry .DefaultBackoff , func () error {
1033
+ subscription , err = fetchSubscription (t , crc , testNamespace , subscriptionName , subscriptionHasInstallPlanChecker )
1034
+ require .NoError (t , err )
1035
+ require .NotNil (t , subscription )
1034
1036
1035
- subscription .Spec .Channel = betaChannel
1036
- subscription , err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).Update (subscription )
1037
- require .NoError (t , err )
1037
+ subscription .Spec .Channel = betaChannel
1038
+ subscription , err = crc .OperatorsV1alpha1 ().Subscriptions (testNamespace ).Update (subscription )
1039
+
1040
+ return err
1041
+ })
1038
1042
1039
1043
// Wait for subscription to have a new installplan
1040
1044
subscription , err = fetchSubscription (t , crc , testNamespace , subscriptionName , subscriptionHasInstallPlanDifferentChecker (fetchedInstallPlan .GetName ()))
0 commit comments