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

correct FBC fragments for OCP versions #14

Merged
merged 3 commits into from
Nov 21, 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "catalog/***".pathChanged() || "Dockerfile.v4-12".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-12-pull-request.yaml".pathChanged()
== "main" && ( "catalog-old/***".pathChanged() || "Dockerfile.v4-12".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-12-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "catalog/***".pathChanged() || "Dockerfile.v4-13".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-13-pull-request.yaml".pathChanged()
== "main" && ( "catalog-old/***".pathChanged() || "Dockerfile.v4-13".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-13-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "catalog/***".pathChanged() || "Dockerfile.v4-14".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-14-pull-request.yaml".pathChanged()
== "main" && ( "catalog-old/***".pathChanged() || "Dockerfile.v4-14".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-14-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "catalog/***".pathChanged() || "Dockerfile.v4-15".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-15-pull-request.yaml".pathChanged()
== "main" && ( "catalog-old/***".pathChanged() || "Dockerfile.v4-15".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-15-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "catalog/***".pathChanged() || "Dockerfile.v4-16".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-16-pull-request.yaml".pathChanged()
== "main" && ( "catalog-old/***".pathChanged() || "Dockerfile.v4-16".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-16-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "catalog/***".pathChanged() || "Dockerfile.v4-17".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-17-pull-request.yaml".pathChanged()
== "main" && ( "catalog-old/***".pathChanged() || "Dockerfile.v4-17".pathChanged() || ".tekton/costmanagement-metrics-operator-fbc-component-v4-17-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.v4-12
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
ADD catalog-old/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.v4-13
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
ADD catalog-old/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.v4-14
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
ADD catalog-old/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.v4-15
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
ADD catalog-old/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.v4-16
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
ADD catalog-old/costmanagement-metrics-operator /configs/costmanagement-metrics-operator
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ DOCKER := $(shell which docker 2>/dev/null || which podman 2>/dev/null)
# Add the bin directory to the PATH
export PATH := $(BINDIR):$(PATH)
# A place to store the generated catalogs
CATALOG_DIR_OLD=${PWD}/catalog-old
CATALOG_DIR=${PWD}/catalog

# A place to store the operator catalog templates
Expand Down Expand Up @@ -43,8 +44,10 @@ $(LOCALBIN):

.PHONY: catalog
catalog: clean opm
mkdir -p ${CATALOG_DIR}/${OPERATOR_NAME}/ && \
$(OPM) alpha render-template basic -o yaml ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME} > ${CATALOG_DIR}/${OPERATOR_NAME}/catalog.yaml;
mkdir -p ${CATALOG_DIR_OLD}/${OPERATOR_NAME}/ ${CATALOG_DIR}/${OPERATOR_NAME}/ && \
$(OPM) alpha render-template basic -o yaml ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME} > ${CATALOG_DIR_OLD}/${OPERATOR_NAME}/catalog.yaml;
$(OPM) alpha render-template basic -o yaml ${OPERATOR_CATALOG_TEMPLATE_DIR}/${CATALOG_TEMPLATE_FILENAME} --migrate-level=bundle-object-to-csv-metadata > ${CATALOG_DIR}/${OPERATOR_NAME}/catalog.yaml;
$(OPM) validate ${CATALOG_DIR_OLD}/${OPERATOR_NAME}
$(OPM) validate ${CATALOG_DIR}/${OPERATOR_NAME}

.PHONY: add-new-version
Expand All @@ -54,10 +57,11 @@ add-new-version: yq

.PHONY: create-catalog-dir
create-catalog-dir:
mkdir -p $(CATALOG_DIR)
mkdir -p $(CATALOG_DIR) $(CATALOG_DIR_OLD)

.PHONY: clean
clean: create-catalog-dir
find $(CATALOG_DIR_OLD) -type d -name ${OPERATOR_NAME} -exec rm -rf {} +
find $(CATALOG_DIR) -type d -name ${OPERATOR_NAME} -exec rm -rf {} +


Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

File-Based Catalog for Cost Management Metrics Operator

**note**: the catalogs differ depending on OCP version:
* 4.16 or earlier, bundle metadata must use the olm.bundle.object format
* 4.17 or later, bundle metadata must use the olm.csv.metadata format
The catalog for <=4.16 is stored in [catalog-old](catalog-old), whereas >=4.17 is stored in [catalog](catalog)

## How to update

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.
Expand Down
581 changes: 581 additions & 0 deletions catalog-old/costmanagement-metrics-operator/catalog.yaml

Large diffs are not rendered by default.

6,070 changes: 5,975 additions & 95 deletions catalog/costmanagement-metrics-operator/catalog.yaml

Large diffs are not rendered by default.