Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regenerate FBC for v3.3.2 #17

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
VERSION ?= 3.3.2
PREVIOUS_VERSION ?= 3.3.1
PULLSPEC ?= quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator/costmanagement-metrics-operator-bundle:68b454426cd10d0cba40de0a3c21a28f44e8989d
REGISTRY_SHA ?= sha256:ea80f29f03b22d54d021ad888d194105237c0345ebc1ddb49af122e815085ac7
USER_WORKLOAD_REPO ?= quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator/costmanagement-metrics-operator-bundle
REGISTRY_REPO ?= registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle
REGISTRY_SHA ?= sha256:448e65667b5c167699778b0056a18b31dc7ed95022c803217a2786d27d21e945

PWD=$(shell pwd)
OPERATOR_NAME=costmanagement-metrics-operator
Expand Down Expand Up @@ -51,10 +52,17 @@ catalog: clean opm
$(OPM) validate ${CATALOG_DIR_OLD}/${OPERATOR_NAME}
$(OPM) validate ${CATALOG_DIR}/${OPERATOR_NAME}

sed -i '' 's|$(USER_WORKLOAD_REPO)|$(REGISTRY_REPO)|g' ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME} ${CATALOG_DIR_OLD}/${OPERATOR_NAME}/catalog.yaml ${CATALOG_DIR}/${OPERATOR_NAME}/catalog.yaml

.PHONY: add-new-version
add-new-version: yq
$(YQ) -i eval 'select(.schema == "olm.template.basic").entries[] |= select(.schema == "olm.channel").entries += [{"name" : "$(OPERATOR_NAME).$(VERSION)", "replaces": "$(OPERATOR_NAME).$(PREVIOUS_VERSION)"}]' ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME}
$(YQ) -i '.entries += [{"image": "$(PULLSPEC)", "schema": "olm.bundle"}]' ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME}
$(YQ) -i '.entries += [{"image": "$(USER_WORKLOAD_REPO)@$(REGISTRY_SHA)", "schema": "olm.bundle"}]' ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME}

.PHONY: remove-new-version
remove-new-version: yq
$(YQ) -i eval 'select(.schema == "olm.template.basic").entries[] |= select(.schema == "olm.channel").entries -= [{"name" : "$(OPERATOR_NAME).$(VERSION)", "replaces": "$(OPERATOR_NAME).$(PREVIOUS_VERSION)"}]' ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME}
$(YQ) -i '.entries -= [{"image": "$(REGISTRY_REPO)@$(REGISTRY_SHA)", "schema": "olm.bundle"}]' ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME}

.PHONY: create-catalog-dir
create-catalog-dir:
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ The catalog for <=4.16 is stored in [catalog-old](catalog-old), whereas >=4.17 i

Updates are made to the [basic-template.yaml](catalog-templates/basic-template.yaml) file and then a catalog is generated from the template. The template can be updated with a Make command.

1. in the [Makefile](Makefile), update `VERSION`, `PREVIOUS_VERSION`, and `PULLSPEC` to the latest values:
1. in the [Makefile](Makefile), update `VERSION`, `PREVIOUS_VERSION`, and `REGISTRY_SHA` to the latest values:
```
VERSION ?= 3.3.1
PREVIOUS_VERSION ?= 3.3.0
PULLSPEC ?= registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:01cab18a6af3cc819a936ce434004d5dce4495474e62bc116643eb753c25cd91
REGISTRY_SHA ?= sha256:01cab18a6af3cc819a936ce434004d5dce4495474e62bc116643eb753c25cd91
```

2. run `make add-new-version` which will add the new version and pullspec to the template:
Expand All @@ -40,3 +40,5 @@ schema: olm.template.basic
```
$ make catalog
```

4. (optional) In case you need to rebuild the bundle after you've already generated the FBC, run `make remove-new-version` to remove the added versions, THEN update the `REGISTRY_SHA` with the new bundle and redo the above steps.
8 changes: 4 additions & 4 deletions catalog-old/costmanagement-metrics-operator/catalog.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion catalog-template/basic-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ entries:
schema: olm.bundle
- image: registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:01cab18a6af3cc819a936ce434004d5dce4495474e62bc116643eb753c25cd91
schema: olm.bundle
- image: quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/costmanagement-metrics-operator/costmanagement-metrics-operator-bundle:68b454426cd10d0cba40de0a3c21a28f44e8989d
- image: registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:448e65667b5c167699778b0056a18b31dc7ed95022c803217a2786d27d21e945
schema: olm.bundle
schema: olm.template.basic
8 changes: 4 additions & 4 deletions catalog/costmanagement-metrics-operator/catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6462,7 +6462,7 @@ relatedImages:
name: manager
schema: olm.bundle
---
image: registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:ea80f29f03b22d54d021ad888d194105237c0345ebc1ddb49af122e815085ac7
image: registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:448e65667b5c167699778b0056a18b31dc7ed95022c803217a2786d27d21e945
name: costmanagement-metrics-operator.3.3.2
package: costmanagement-metrics-operator
properties:
Expand Down Expand Up @@ -6515,7 +6515,7 @@ properties:
capabilities: Seamless Upgrades
categories: Monitoring
certified: "true"
containerImage: registry.redhat.io/costmanagement/costmanagement-metrics-rhel9-operator@sha256:cc46f919ee9f365abba4398e2a30511761371f204264cdc6e06e8254008577e9
containerImage: registry.redhat.io/costmanagement/costmanagement-metrics-rhel9-operator@sha256:aaff1e2e5ceae6e1ba91c32e60e5260883a8d4842895ed367d273afab303d1f2
createdAt: "2024-11-12T16:54:18Z"
description: A Golang-based OpenShift Operator that generates and uploads OpenShift
usage metrics to cost management.
Expand Down Expand Up @@ -6878,8 +6878,8 @@ properties:
provider:
name: Red Hat
relatedImages:
- image: registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:ea80f29f03b22d54d021ad888d194105237c0345ebc1ddb49af122e815085ac7
- image: registry.redhat.io/costmanagement/costmanagement-metrics-operator-bundle@sha256:448e65667b5c167699778b0056a18b31dc7ed95022c803217a2786d27d21e945
name: ""
- image: registry.redhat.io/costmanagement/costmanagement-metrics-rhel9-operator@sha256:cc46f919ee9f365abba4398e2a30511761371f204264cdc6e06e8254008577e9
- image: registry.redhat.io/costmanagement/costmanagement-metrics-rhel9-operator@sha256:aaff1e2e5ceae6e1ba91c32e60e5260883a8d4842895ed367d273afab303d1f2
name: costmanagement-metrics-operator
schema: olm.bundle