Skip to content

[minor] Allow installPlanApproval and startingCSV to be set on subscriptions#206

Merged
sanjayprab merged 6 commits intostablefrom
ajw-grafana-fix
Mar 6, 2026
Merged

[minor] Allow installPlanApproval and startingCSV to be set on subscriptions#206
sanjayprab merged 6 commits intostablefrom
ajw-grafana-fix

Conversation

@whitfiea
Copy link
Member

@whitfiea whitfiea commented Mar 6, 2026

Resolves ibm-mas/ansible-devops#2149

Updates the olm.py to allow the applySubscription function to be passed in an optional installPlanApproval and startingCSV value. This is primarily used in the case where were the latest subscription version has an issue and so the solution is to install a previous one and stop OLM from automatically updating. The case that caused this to be added was the grafana-operator update.

The logic in the function is as follows:

  • installPlanApproval and startingCSV are optional, not providing them is what happens without this fix which is automatic approval.
  • installPlanApproval set to manual requires startingCSV to be set.
  • if we have an installplan created with the clusterservicename containing the startingCSV then we approve that install as that will be the one required.
  • any installplan that does not contain the startingCSV will not be approved automatically.
  • if the subscription status is UpgradePending and installPlanApproval is manual then we check the installplan we want is complete and return.

Tested using the grafana-operator and with PR in ansible-devops both locally and in fvt-personal:

image- 2026-03-06 at 10 33 09@2x image- 2026-03-06 at 14 08 53@2x image- 2026-03-06 at 14 09 03@2x image- 2026-03-06 at 14 09 29@2x

Unit tests added/updated.

@sanjayprab sanjayprab added this pull request to the merge queue Mar 6, 2026
Merged via the queue into stable with commit b9bdb3c Mar 6, 2026
3 checks passed
@sanjayprab sanjayprab deleted the ajw-grafana-fix branch March 6, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grafana operator can not be installed

2 participants