Approve pending InstallPlans for operator installations and upgrades
Approves pending InstallPlans for operators with manual approval mode to proceed with installations or upgrades.
/plugin marketplace add openshift-eng/ai-helpers/plugin install olm@ai-helpers<operator-name> [namespace] [--all]olm:approve
/olm:approve <operator-name> [namespace] [--all]
The olm:approve command approves pending InstallPlans for operators with manual approval mode. This is required for operators that have installPlanApproval: Manual in their Subscription to proceed with installation or upgrades.
This command helps you:
The command performs the following steps:
Parse Arguments:
$1: Operator name (required) - Name of the operator$2: Namespace (optional) - Namespace where operator is installed
$3: Flag (optional):
--all: Approve all pending InstallPlans in the namespacePrerequisites Check:
oc CLI is installed: which ococ whoamiLocate Operator:
oc get subscription {operator-name} -n {namespace} --ignore-not-found
oc get subscription --all-namespaces -o json | jq -r '.items[] | select(.spec.name=="{operator-name}") | .metadata.namespace'
Check Subscription Approval Mode:
oc get subscription {operator-name} -n {namespace} -o jsonpath='{.spec.installPlanApproval}'
ℹ️ Operator '{operator-name}' has automatic approval enabled.
InstallPlans are approved automatically and don't require manual intervention.
Current Subscription approval mode: Automatic
To switch to manual approval mode:
oc patch subscription {operator-name} -n {namespace} \
--type merge --patch '{"spec":{"installPlanApproval":"Manual"}}'
Find Pending InstallPlans:
oc get installplan -n {namespace} -o json
oc get installplan -n {namespace} -o json | \
jq '.items[] | select(.spec.approved==false and .spec.clusterServiceVersionNames[] | contains("{operator-name}"))'
✓ No pending InstallPlans found for operator '{operator-name}'
The operator is up to date or already approved.
To check operator status: /olm:status {operator-name} {namespace}
Display InstallPlan Details: For each pending InstallPlan, display:
⏸️ Pending InstallPlan Found
InstallPlan: {installplan-name}
Namespace: {namespace}
Phase: {phase}
Approved: false
ClusterServiceVersions to be installed/upgraded:
- {csv-name-1} ({version-1})
- {csv-name-2} ({version-2})
Resources to be created/updated:
- CustomResourceDefinitions: {crd-count}
- ServiceAccounts: {sa-count}
- ClusterRoles: {role-count}
- Deployments: {deployment-count}
[If upgrade:]
Current Version: {current-version}
Target Version: {target-version}
Request User Confirmation (unless --all or --force flag):
Do you want to approve this InstallPlan? (yes/no)
Approve InstallPlan:
oc patch installplan {installplan-name} -n {namespace} \
--type merge --patch '{"spec":{"approved":true}}'
oc get installplan {installplan-name} -n {namespace} -o jsonpath='{.spec.approved}'
✓ InstallPlan approved: {installplan-name}
Monitor InstallPlan Execution (optional):
oc get installplan {installplan-name} -n {namespace} -w --timeout=120s
🔄 InstallPlan executing...
⏳ Installing resources...
Verify Installation/Upgrade:
oc get csv -n {namespace} -o json | \
jq -r '.items[] | select(.status.phase=="Succeeded") | .metadata.name'
✓ Operator installation/upgrade complete
CSV: {csv-name}
Version: {version}
Phase: Succeeded
To check operator status: /olm:status {operator-name} {namespace}
Handle Multiple InstallPlans (if --all flag):
✓ Approved {count} InstallPlan(s)
Approved:
- {installplan-1}
- {installplan-2}
Monitoring installation progress...
Display Approval Summary:
✓ Approval Complete!
Operator: {operator-name}
Namespace: {namespace}
Approved InstallPlans: {count}
InstallPlan Status:
- {installplan-1}: Complete
- {installplan-2}: Installing...
Monitor progress: watch oc get csv,installplan -n {namespace}
Approve pending InstallPlan for an operator:
/olm:approve openshift-cert-manager-operator
Approve with specific namespace:
/olm:approve external-secrets-operator eso-operator
Approve all pending InstallPlans:
/olm:approve openshift-cert-manager-operator cert-manager-operator --all
This approves all pending InstallPlans for the operator in the namespace.
Check and approve after upgrade command:
/olm:upgrade openshift-cert-manager-operator --channel=tech-preview
# Wait for InstallPlan to be created
/olm:approve openshift-cert-manager-operator
--all: Approve all pending InstallPlans for this operator
installPlanApproval: Manual in their SubscriptionNo pending InstallPlans:
# List all InstallPlans
oc get installplan -n {namespace}
# Check if operator is in automatic mode
oc get subscription {operator-name} -n {namespace} -o jsonpath='{.spec.installPlanApproval}'
InstallPlan not executing after approval:
# Check InstallPlan status
oc describe installplan {installplan-name} -n {namespace}
# Check for errors
oc get events -n {namespace} --sort-by='.lastTimestamp' | grep InstallPlan
CSV not reaching Succeeded phase:
# Check CSV status
oc describe csv -n {namespace}
# Check operator deployment
oc get deployments -n {namespace}
# Check operator logs
oc logs -n {namespace} deployment/{operator-deployment}
Permission denied:
# Check if you can patch InstallPlans
oc auth can-i patch installplan -n {namespace}
Multiple namespaces found:
/olm:approve {operator-name} {specific-namespace}
/olm:status <operator-name> - Check if InstallPlans are pending approval/olm:upgrade <operator-name> - Trigger upgrade and approve in one command/olm:install <operator-name> - Install operator with approval mode/olm:list - List operators and their approval modes