diff --git a/operators-installer/templates/installplan-approver/installplan-approver.yaml b/operators-installer/templates/installplan-approver/installplan-approver.yaml index 5ef0738..b1296d9 100644 --- a/operators-installer/templates/installplan-approver/installplan-approver.yaml +++ b/operators-installer/templates/installplan-approver/installplan-approver.yaml @@ -49,9 +49,11 @@ spec: {{- \$installPlanItem := . -}} {{- range .spec.clusterServiceVersionNames -}} {{- if and (eq . "${SUBSCRIPTION_CSV}") (not \$installPlanName) -}} - {{- range \$installPlanItem.metadata.ownerReferences -}} - {{- if eq .uid "${subscriptionUID}" -}} - {{- \$installPlanName = \$installPlanItem.metadata.name -}} + {{- if or (eq \$installPlanItem.status.phase "RequiresApproval") (eq \$installPlanItem.status.phase "Complete") -}} + {{- range \$installPlanItem.metadata.ownerReferences -}} + {{- if eq .uid "${subscriptionUID}" -}} + {{- \$installPlanName = \$installPlanItem.metadata.name -}} + {{- end -}} {{- end -}} {{- end -}} {{- end -}}