This repository is for building and releasing the ACS operator indexes on Konflux.
It's for updating Operator Catalogs, i.e., so OpenShift clusters can see new versions of ACS operator in their
OperatorHub.
If some pipeline failed, you can restart it by commenting in the PR /test <pipeline-name> (e.g. /test operator-index-ocp-v4-16-on-push).
See more in our docs.
Do the following changes in the catalog-template.yaml file.
-
Add bundle image.
- Find entries with
schema: olm.bundletowards the end of the file. - Add a new entry for your bundle image.
It should look something like this:- schema: olm.bundle # 4.7.9 image: quay.io/rhacs-eng/release-operator-bundle@sha256:c82e8330c257e56eb43cb5fa7b0c842a7f7f0414e32e26a792ef36817cb5ca02
- Note that the image must be referenced by digest, not by tag.
- Keep entries sorted according to version.
- Add a comment stating the version, see how it's done for other items there.
- You may add bundle images from
quay.io,brew.registry.redhat.ioand so on (provided they exist and are pullable) during development and/or when preparing to release.
Ultimately, all released bundle images must come fromregistry.redhat.io/advanced-cluster-security/rhacs-operator-bundlerepo because this is where customers expect to find them. There's a CI check which prevents pushing tomasterif there's any bundle from a different repo.
- Find entries with
-
Add entry to the
stablechannel.- Find the
stablechannel block. It starts with:- schema: olm.channel name: stable
- Add a new item into its
entrieslist.- Entries must be sorted by version (e.g., you must insert
4.8.2after4.8.1but before4.9.0). - Ensure there are consistent blank lines between entries of different Y-streams.
- Entry format is
Replace
- &bundle-4-Y-Z name: rhacs-operator.v4.Y.Z replaces: rhacs-operator.v4.PREVIOUS_Y.PREVIOUS_Z skipRange: '>= 4.(Y-1).0 < 4.Y.Z'
Ywith minor version (e.g.,8in4.8.2),Zwith patch version (e.g.,2in4.8.2),PREVIOUS_YandPREVIOUS_Zwith minor and patch versions of the previous item (e.g., when you add4.8.2after4.8.1, that'd be8and1; when you add4.9.0after4.8.3, that'd be8and3),(Y-1)with the value ofYminus 1 (e.g., when you add4.8.2, that'd be7).
- Entries must be sorted by version (e.g., you must insert
- If the item you added is not the last one in the
entrieslist, i.e., not the highest version, adjust the next item in theentrieslist.
Set itsreplaces:to berhacs-operator.v4.Y.Z.
For example:- &bundle-4-7-4 # <-------- this was already there name: rhacs-operator.v4.7.4 replaces: rhacs-operator.v4.7.3 skipRange: '>= 4.6.0 < 4.7.4' - &bundle-4-7-5 # <-------- this one I'm adding name: rhacs-operator.v4.7.5 replaces: rhacs-operator.v4.7.4 skipRange: '>= 4.6.0 < 4.7.5' - &bundle-4-8-0 # <-------- this was already there name: rhacs-operator.v4.8.0 replaces: rhacs-operator.v4.7.4 # <-------- must change here to rhacs-operator.v4.7.5 skipRange: '>= 4.7.0 < 4.8.0'
- Find the
-
Add entry to
rhacs-4.?channels.- For every
schema: olm.channelwithnamelikerhacs-4.?where?is >=Y, - add
- *bundle-4-Y-Zto theentries:list (replacingYandZwith minor and patch versions). - Maintain the entries sorted and with consistent linebreaks.
- For every
-
Add
rhacs-4.Ychannel. Skip this step if the channel already exists (i.e., whenZ>0).- Keep the channels sorted.
- In the
entries:, reference all items from4.0.0up to (and including)4.Y.Z.
It should look something like this (replacing
Y,Zas appropriate):- schema: olm.channel name: rhacs-4.Y package: rhacs-operator entries: - *bundle-4-0-0 - *bundle-4-0-1 # ... and so on ... - *bundle-4-Y-Z
Once done with catalog-template.yaml:
- Update catalogs (follow updating catalogs steps below).
- Open a PR with
Add 4.Y.Z versiontitle.
Run
make clean && make valid-catalogs
Note: this will take a while.
If a new bundle was added then you should see that catalog-bundle-object/rhacs-operator/catalog.json and catalog-csv-metadata/rhacs-operator/catalog.json files are changed.
The following documentation was used for setting up catalogs update (this and this).
Run ./scripts/get-built-images.sh [COMMIT] to fetch built operator catalog images for the provided COMMIT for each supported OCP version.
Note: The script uses current branch commit if no COMMIT argument provided.
This directory contains two versions of the catalog, in subdirectories catalog-bundle-object and catalog-csv-metadata.
The former is expected by OpenShift versions up to and including 4.16, and the latter - by 4.17 and later.
See konflux docs.
- Make sure you logged in to the Konflux cluster.
- Make sure you checked out the latest master branch:
git checkout master && git pull - Generate Release and Snapshot CRs by running
./scripts/generate-releases.sh <staging|prod>. Usestagingfor test release andprodfor production one. - (Skip for
stagingrelease.) Create a PR which adds the file created by the script, get the PR reviewed and merged. - (Skip for
stagingrelease.) Go to the #acs-operator-index-release channel, and:- make sure the previous operator index release is complete (has a green check mark emoticon)
- if not, coordinate with the person conducting that release
- once that release is complete, start a new thread for your release
- Apply generated CRs to the cluster:
oc create -f release-history/<YYYY-MM-DD>-<SHA>-<staging|prod>.yaml - Monitor release using monitor release script. Each supported OCP version has its own
Release. Successfully finishedReleasehasSucceededstatus. - Follow the restarting release step below if any of the
Releases fails for any OCP version. - (Skip for
stagingrelease.) Once done, go back to the Slack thread you started earlier, add a message that your release is done and add a green check mark emoticon on the initial message of the thread. - Once releases for all OCP versions successfully finish, then the operator catalog release is done. If you perform it as part of a bigger release procedure, you should go back to that procedure and continue with further steps.
Run ./scripts/monitor-release.sh [COMMIT] to see the current status for the releases associated with the provided COMMIT.
Note: The script uses current branch commit if no COMMIT argument provided.
If a particular Release fails (i.e. the CRs status changes to Failed), you should restart it until it succeeds. Failing to do so will leave corresponding OpenShift Operator catalog without updates.
- Open
acs-operator-index-ocp-v4-XXKonflux application for OCP version you want to restart (XXmeans minor part of the OCP version). - Select
Releasestab. - Find release by name you want to restart.
- Click on the action menu (3 dots) on the right.
- Press "Re-run release" option. This creates a new Release CR.
- Monitor the new release.
- Repeat restarting release if the release keeps failing. If you find yourself re-running a given
Releasefive times or more, open a high severity request in #konflux-users Slack channel describing the problem and providing names/links to Release CRs.
