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.bundle
towards 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: brew.registry.redhat.io/rh-osbs/rhacs-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.io
and 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-bundle
repo because this is where customers expect to find them. There's a CI check which prevents pushing tomaster
if there's any bundle from a different repo. - If you're adding a bundle as part of downstream release, you will find bundle image's digest in the email with
a subject
[CVP] (SUCCESS) cvp-redhatadvancedclustersecurity: rhacs-operator-bundle-container-4.Y.Z-x
. Open the link inBrew Build Info
and find the digest of theregistry-proxy.engineering.redhat.com/rh-osbs/rhacs-operator-bundle
image. Take that image and replaceregistry-proxy.engineering.redhat.com
withbrew.registry.redhat.io
.
- Find entries with
-
Add entry to the
stable
channel.- Find the
stable
channel block. It starts with:- schema: olm.channel name: stable
- Add a new item into its
entries
list.- Entries must be sorted by version (e.g., you must insert
4.8.2
after4.8.1
but 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'
Y
with minor version (e.g.,8
in4.8.2
),Z
with patch version (e.g.,2
in4.8.2
),PREVIOUS_Y
andPREVIOUS_Z
with minor and patch versions of the previous item (e.g., when you add4.8.2
after4.8.1
, that'd be8
and1
; when you add4.9.0
after4.8.3
, that'd be8
and3
),(Y-1)
with the value ofY
minus 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
entries
list, i.e., not the highest version, adjust the next item in theentries
list.
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.channel
withname
likerhacs-4.?
where?
is >=Y
, - add
- *bundle-4-Y-Z
to theentries:
list (replacingY
andZ
with minor and patch versions). - Maintain the entries sorted and with consistent linebreaks.
- For every
-
Add
rhacs-4.Y
channel. Skip this step if the channel already exists (i.e., whenZ
>0
).- Keep the channels sorted.
- In the
entries:
, reference all items from4.0.0
up to (and including)4.Y.Z
.
It should look something like this (replacing
Y
,Z
as 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 version
title.
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>
. Usestaging
for test release andprod
for production one. - (Skip for
staging
release.) Create a PR which adds the file created by the script, get the PR reviewed and merged. - (Skip for
staging
release.) 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 finishedRelease
hasSucceeded
status. - Follow the restarting release step below if any of the
Release
s fails for any OCP version. - (Skip for
staging
release.) 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-XX
Konflux application for OCP version you want to restart (XX
means minor part of the OCP version). - Select
Releases
tab. - 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
Release
five times or more, open a high severity request in #konflux-users Slack channel describing the problem and providing names/links to Release CRs.