Skip to content

Commit 7ec6a69

Browse files
Merge pull request #724 from iamniting/install-plan
controllers: approve InstallPlans only in RequiresApproval phase
2 parents 458c44a + 2435184 commit 7ec6a69

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

controllers/subscriptions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ func ApproveInstallPlanForCsv(ctx context.Context, cli client.Client, csvName st
331331
if slices.Contains(installPlan.Spec.ClusterServiceVersionNames, csvName) {
332332
foundInstallPlan = true
333333
if installPlan.Spec.Approval == opv1a1.ApprovalManual &&
334+
installPlan.Status.Phase == opv1a1.InstallPlanPhaseRequiresApproval &&
334335
!installPlan.Spec.Approved {
335336

336337
installPlans.Items[i].Spec.Approved = true

0 commit comments

Comments
 (0)