@@ -217,8 +217,25 @@ var _ = Describe("Subscription", func() {
217
217
require .Equal (GinkgoT (), v1alpha1 .ApprovalManual , installPlan .Spec .Approval )
218
218
require .Equal (GinkgoT (), v1alpha1 .InstallPlanPhaseRequiresApproval , installPlan .Status .Phase )
219
219
220
- installPlan .Spec .Approved = true
221
- _ , err = crc .OperatorsV1alpha1 ().InstallPlans (testNamespace ).Update (context .Background (), installPlan , metav1.UpdateOptions {})
220
+ // Delete the current installplan
221
+ err = crc .OperatorsV1alpha1 ().InstallPlans (testNamespace ).Delete (context .Background (), installPlan .Name , metav1.DeleteOptions {})
222
+ require .NoError (GinkgoT (), err )
223
+
224
+ subscription , err = fetchSubscription (crc , testNamespace , "manual-subscription" , subscriptionStateUpgradePendingChecker )
225
+ require .NoError (GinkgoT (), err )
226
+ require .NotNil (GinkgoT (), subscription )
227
+
228
+ // Fetch new installplan
229
+ newInstallPlan , err := fetchInstallPlan (GinkgoT (), crc , subscription .Status .Install .Name , buildInstallPlanPhaseCheckFunc (v1alpha1 .InstallPlanPhaseRequiresApproval ))
230
+ require .NoError (GinkgoT (), err )
231
+ require .NotNil (GinkgoT (), newInstallPlan )
232
+
233
+ require .NotEqual (GinkgoT (), installPlan .Name , newInstallPlan .Name , "expected new installplan recreated" )
234
+ require .Equal (GinkgoT (), v1alpha1 .ApprovalManual , newInstallPlan .Spec .Approval )
235
+ require .Equal (GinkgoT (), v1alpha1 .InstallPlanPhaseRequiresApproval , newInstallPlan .Status .Phase )
236
+
237
+ newInstallPlan .Spec .Approved = true
238
+ _ , err = crc .OperatorsV1alpha1 ().InstallPlans (testNamespace ).Update (context .Background (), newInstallPlan , metav1.UpdateOptions {})
222
239
require .NoError (GinkgoT (), err )
223
240
224
241
subscription , err = fetchSubscription (crc , testNamespace , "manual-subscription" , subscriptionStateAtLatestChecker )
0 commit comments