File-Based Catalog for Cost Management Metrics Operator
NOTE: The catalog and bundle metadata format are dependent on the OCP version:
-
OCP >= 4.17:
- The catalog is stored in catalog.
- Bundle metadata must use the
olm.csv.metadataformat.
-
OCP <= 4.16:
- The catalog is stored in catalog-old.
- Bundle metadata must use the
olm.bundle.objectformat.
-
OCP (4.12, 4.13):
- OCP stopped multiarch builds for ose-operator-registry for these versions. The images built are for
x86_64only.
- OCP stopped multiarch builds for ose-operator-registry for these versions. The images built are for
Updates are made to the basic-template.yaml file and then a catalog is generated from the template. The template can be updated with a Make command.
-
in the Makefile, update
VERSION,PREVIOUS_VERSION, andREGISTRY_SHAto the latest values:VERSION ?= 3.3.2 PREVIOUS_VERSION ?= 3.3.1 REGISTRY_SHA ?= sha256:448e65667b5c167699778b0056a18b31dc7ed95022c803217a2786d27d21e945 -
run
make add-new-versionwhich will add the new version and pullspec to the template:$ make add-new-versionwhich results in:
... - name: costmanagement-metrics-operator.3.3.2 replaces: costmanagement-metrics-operator.3.3.1 name: stable package: costmanagement-metrics-operator schema: olm.channel ... - image: quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator/costmanagement-metrics-operator-bundle@sha256:448e65667b5c167699778b0056a18b31dc7ed95022c803217a2786d27d21e945 schema: olm.bundle schema: olm.template.basic -
Rebuild the FBC (this will be very slow, especially the first time running this command). This command also validates the outputted FBC and perform post-processing to replace the
quay.io/redhat-user-workloadstest repo with the correctregistry.redhat.io/costmanagementbundle repo in the FBCs and basic-template:$ make catalog -
(optional) In case you need to rebuild the bundle after you've already generated the FBC, run
make remove-new-versionto remove the added versions, THEN update theREGISTRY_SHAwith the new bundle and redo the above steps.
-
Login into the konflux cluster via sso:
oc login --web https://api.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443 # make sure your in cost-mgmt-dev-tenant namespace oc project cost-mgmt-dev-tenant -
Get the releases associated with the commit sha for the PR which updated the FBCs:
$ oc get release -l pac.test.appstudio.openshift.io/sha=239a845fb3b253c0dafbeae07e4144c2832d5735 NAME SNAPSHOT RELEASEPLAN RELEASE STATUS AGE costmanagement-metrics-operator-fbc-v4-12-rtmmp-4wgpm costmanagement-metrics-operator-fbc-v4-12-rtmmp costmanagement-metrics-operator-stage-fbc-v4-12 Succeeded 3h2m costmanagement-metrics-operator-fbc-v4-13-n2xgp-95m5v costmanagement-metrics-operator-fbc-v4-13-n2xgp costmanagement-metrics-operator-stage-fbc-v4-13 Succeeded 3h2m costmanagement-metrics-operator-fbc-v4-14-x65bx-bccs5 costmanagement-metrics-operator-fbc-v4-14-x65bx costmanagement-metrics-operator-stage-fbc-v4-14 Succeeded 3h1m costmanagement-metrics-operator-fbc-v4-15-hbxf4-m7q44 costmanagement-metrics-operator-fbc-v4-15-hbxf4 costmanagement-metrics-operator-stage-fbc-v4-15 Succeeded 3h1m costmanagement-metrics-operator-fbc-v4-16-bhxlx-6gx4f costmanagement-metrics-operator-fbc-v4-16-bhxlx costmanagement-metrics-operator-stage-fbc-v4-16 Succeeded 3h2m costmanagement-metrics-operator-fbc-v4-17-tj4p5-4z948 costmanagement-metrics-operator-fbc-v4-17-tj4p5 costmanagement-metrics-operator-stage-fbc-v4-17 Succeeded 3h1m
The
RELEASE STATUSshould beSucceeded!NOTE: To prevent snapshots from being pruned by konflux's garbage collection, add the annotation below to all snapshots that will be passed on to QE for testing.
oc annotate snapshot <snapshot> test.appstudio.openshift.io/keep-snapshot=true
-
Get the component and image:
$ oc get snapshot -l pac.test.appstudio.openshift.io/sha=239a845fb3b253c0dafbeae07e4144c2832d5735 -o jsonpath='{range .items[*]}{@.spec.components[].name}{" "}{@.spec.components[].containerImage}{"\n"}{end}' costmanagement-metrics-operator-fbc-component-v4-12 quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-12@sha256:243f5ddd2d7cd758afcbbcdea118d70a78cf337fe82184f33cb33a72185ca0df costmanagement-metrics-operator-fbc-component-v4-13 quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-13@sha256:4bc223ef026c2da93ef4dbc0550f9c5e61fbe391225699241e4a46421e5e4a33 costmanagement-metrics-operator-fbc-component-v4-14 quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-14@sha256:0bc13823aa724952c30af90045f69e80dca79b182babd5cb25971d50592949f7 costmanagement-metrics-operator-fbc-component-v4-15 quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-15@sha256:0b0fae192d572f26a3a5d8667838c81eca598fbf8595159b431fd2bb89118670 costmanagement-metrics-operator-fbc-component-v4-16 quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-16@sha256:4edbd45925c170b43a60441f2693a3e07f8bfc7e635f5cecf96bea2a185be8d5 costmanagement-metrics-operator-fbc-component-v4-17 quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-17@sha256:503a802959536d725a318a21902641168bf7b68d36a7e9fcb9ac431608266ae1 -
These are the
CatalogSourceimages and are passed to QE for testing.
-
install python dependencies:
pipenv install --deploy
-
run the
configure_cluster.py, providing the image corresponding to the OCP verison under test. For example, on an OCP v4.16 clsuter:pipenv run ./configure_cluster.py -i quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator-fbc-component-v4-16@sha256:4edbd45925c170b43a60441f2693a3e07f8bfc7e635f5cecf96bea2a185be8d5
This will configure the cluster to:
- disable default OperatorHub sources
- install an ImageDigestMirrorSet which allows the cluster to pull the operator images which have not landed in registry.readhat.io yet.
- install the CatalogSource to make the operater installable through Operator Hub.