This is a short guide on how to build and test OLM manifests for the Stackable operators.
The workflow contains these steps:
- Generate OLM Manifests
- Build and Install Bundles
- Test Operators
- An OpenShift or an OKD cluster
- operator-sdk
- docker
- kubectl
Before generating OLM manifests for an operator ensure that you have checked out the correct branch or tag in the corresponding operator repository.
The OLM manifests are usually generated into the OpenShift Certified Operators Repository which is the source of the certification process.
The manifest generation for these two operators is only partially automated. You start with the script below and then manually update the cluster service version. To generate the manifests for the secret operator version 24.11.1, run:
./olm/build-manifests.sh -r 24.11.1 \
-c $HOME/repo/stackable/openshift-certified-operators \
-o $HOME/repo/stackable/secret-operatorWhere:
-r <release>: the release number (mandatory). This must be a semver-compatible value to patch-level e.g. 23.1.0.-c <manifest folder>: the output folder for the manifest files-o <operator-dir>: directory of the operator repository
Similarly for the listener operator run:
./olm/build-manifests.sh -r 24.11.1 \
-c $HOME/repo/stackable/openshift-certified-operators \
-o $HOME/repo/stackable/listener-operator./olm/build-manifests.py \
--openshift-versions 'v4.14-v4.16' \
--release 24.11.1 \
--repo-operator ~/repo/stackable/hbase-operatorSee ./olm/build-manifests.py --help for the description of command line arguments.
Operator bundles are needed to test the OLM manifests but not needed for the operator certification.
To build operator bundles run:
./olm/build-bundles.sh \
-c $HOME/repo/stackable/openshift-certified-operators \
-r 24.11.1 \
-o listener \
-dWhere:
-r <release>: the release number (mandatory). This must be a semver-compatible value to patch-level e.g. 23.1.0.-c <manifest folder>: the folder with the input OLM manifests for the bundle-o <operator-name>: the operator name (mandatory) e.g. "airflow"-d: Optional. Deploy the bundle. Default: false.
N.B. This action will push the bundles to oci.stackable.tech and requires that the user be logged in first. This can be done by copying the CLI token from the Harbor UI once you are logged in there (see under "Profile"), and then using this as the password when prompted on entering docker login oci.stackabe.tech.
To test operator upgrades run operator-sdk run bundle-upgrade like this:
operator-sdk run bundle-upgrade \
oci.stackable.tech/sandbox/listener-bundle:24.11.2 \
--namespace stackable-operatorsTo run the integration tests against an operator installation (ex. listener):
./scripts/run-tests --skip-operator listener --test-suite openshiftHere we skip the installation of the listener operator by the test suite because this is already installed as an operator bundle.
To remove an operator bundle and all associated objects, run:
operator-sdk cleanup listener-operator --namespace stackable-operators