MAS CLI cannot handle pre-existing OpenShift Pipelines subscription
Trying to install Manage using pipeline, and the pipeline gets stuck on the first step (pre-install-check) with this error message:
TASK [ibm.mas_devops.ocp_verify : Check Subscription Status] ******************* Checking Subscriptions are up to date (60 retries with a 300 second delay) /opt/app-root/lib64/python3.9/site-packages/urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host '172.30.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings warnings.warn(
export IBM_ENTITLEMENT_KEY=xxx
mas install --mas-catalog-version v8-amd64 --accept-license
--license-file /scripts/license.dat
--uds-email '[email protected]' --uds-firstname 'Marek' --uds-lastname 'Polujan'
--storage-rwo 'ocs-storagecluster-ceph-rbd' --storage-rwx 'ocs-storagecluster-cephfs' --storage-pipeline 'ocs-storagecluster-cephfs' --storage-accessmode 'ReadWriteMany'
--mas-instance-id 'inst1' --mas-workspace-id 'masdev' --mas-workspace-name 'masdev'
--mas-channel '8.11.x' --non-prod
--manage-channel 8.7.x
--manage-jdbc workspace-application --manage-components base=latest,health=latest --manage-demodata
--db2u-channel v110508.0 --db2u-manage
--db2u-cpu-request 4000m --db2u-cpu-limit 6000m --db2u-memory-request 8Gi --db2u-memory-limit 12Gi
--db2u-backup-storage 100Gi --db2u-data-storage 100Gi --db2u-logs-storage 100Gi --db2u-meta-storage 20Gi --db2u-temp-storage 100Gi
You whaven't provided any error message. The above is just a warning about use of self-signed certificates.
Attached the full log. The error is as follows:
fatal: [localhost]: FAILED! =>
msg: 'Error: One or more subscriptions did not update to the latest known operator version'
NO MORE HOSTS LEFT *************************************************************
* openshift-operators/openshift-pipelines-operator = None
* openshift-operators/openshift-pipelines-operator-rh-latest-redhat-operators-openshift-marketplace = AtLatestKnown
*
Looks like you already had openshift-pipelines installed (openshift-pipelines-operator-rh-latest-redhat-operators-openshift-marketplace), and the CLI wasn't smart enough to detect this and installed it's own subscription (openshift-pipelines-operator) .. which could never get healthy (understandably).
Does that sound likely (that you already have openshift pipelines subscription installed via another means)?
If so, this should be reasonably simple for us to provide a fix by adding some logic to check whether there's a subscription for this operator already in place (at the moment it makes a rather large assumption that if there is an existing subscription it is called exactly openshift-pipelines-operator, anything else and you'd end up in the scenario you're in here)
For dev working on this, steps to reproduce:
- Install OpenShift Pipelines on OCP using the OpenShift Console (OperatorHub)
- Run
mas install
The installer won't find the existing subscription, and will try to create a new one, which will screw everything up.
In the new python-based CLI the issue lies here: https://github.com/ibm-mas/python-devops/blob/7c4e4baab5dcd00d061a693a9d288bf2481b3b51/src/mas/devops/tekton.py#L32
We simply apply the subscription without checking "is there a subscription already by a different name", assuming that the CLI was the creator of any existing subscription.
We should add a check here "is openshift pipelines operator already available, if so then there's nothing to do"
Fix delivered into https://github.com/ibm-mas/python-devops/releases/tag/1.5.2 and will be available in the next release of the CLI