Skip to content

Commit 8885695

Browse files
authored
NETOBSERV-2108: fix upstream catalog generation (#1232)
* NETOBSERV-2108: fix upstream catalog generation - Move to FBC upstream (and remove non-FBC commands from Makefile) - Add script to refresh catalogs from redhat prod - Prepare released/unreleased structure, as well as main/legacy * Restore next release candidate for konflux-fbc builds * fix downstream dockerfil
1 parent e414e32 commit 8885695

31 files changed

+10367
-8415
lines changed

Makefile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ IMAGE_TAG_BASE ?= $(REPO)/network-observability-operator
6666
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMAGE=<some-registry>/<project-name-bundle>:<tag>)
6767
BUNDLE_IMAGE ?= $(IMAGE_TAG_BASE)-bundle:v$(BUNDLE_VERSION)
6868

69-
70-
# FBC_IMAGE defines the image:tag used for the file based catalog.
71-
# You can use it as an arg. (E.g make bundle-build FBC_IMAGE=<some-registry>/<project-name-fbc>:<tag>)
72-
FBC_IMAGE ?= $(IMAGE_TAG_BASE)-fbc:v$(FBC_VERSION)
73-
7469
# BUNDLE_CONFIG is the config sources to use for OLM bundle - "config/openshift-olm" for OpenShift, or "config/k8s-olm" for upstream Kubernetes.
7570
BUNDLE_CONFIG ?= config/openshift-olm
7671

@@ -435,14 +430,6 @@ bundle-build: ## Build the bundle image.
435430
bundle-push: ## Push the bundle image.
436431
$(OCI_BIN) push ${BUNDLE_IMAGE};
437432

438-
.PHONY: file-based-catalog-build
439-
file-based-catalog-build: ## Build the bundle image.
440-
$(OCI_BIN) build $(OCI_BUILD_OPTS) -f catalog.Dockerfile -t $(FBC_IMAGE) .
441-
442-
.PHONY: file-based-catalog-push
443-
file-based-catalog-push: ## Push the bundle image.
444-
$(OCI_BIN) push ${FBC_IMAGE};
445-
446433
# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMAGES=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0).
447434
# These images MUST exist in a registry and be pull-able.
448435
BUNDLE_IMAGES ?= $(BUNDLE_IMAGE)
@@ -455,16 +442,17 @@ ifneq ($(origin CATALOG_BASE_IMAGE), undefined)
455442
FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMAGE)
456443
endif
457444

445+
.PHONY: refresh-prod-catalogs
446+
refresh-prod-catalogs: opm YQ ## Refresh FBC from production catalogs. Set REGISTRY_AUTH_FILE=/path/to/pull-secret.json for authentication.
447+
YQ=$(YQ) OPM=$(OPM) ./hack/refresh-redhat-catalog.sh
448+
458449
# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'.
459450
# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see:
460451
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
461452
.PHONY: catalog-build
462453
catalog-build: opm ## Build a catalog image.
463-
$(OPM) index add --container-tool ${OCI_BIN} --mode semver --tag $(CATALOG_IMAGE) --bundles $(BUNDLE_IMAGES) $(FROM_INDEX_OPT) $(OPM_OPTS)
464-
465-
.PHONY: file-based-catalog-update
466-
file-based-catalog-update: opm ## Build a catalog image.
467-
OPM=$(OPM) BUNDLE_IMAGE=$(BUNDLE_IMAGE) BUNDLE_TAG="v$(BUNDLE_VERSION)" ./hack/update_fbc.sh
454+
OPM=$(OPM) BUNDLE_IMAGE=$(BUNDLE_IMAGE) BUNDLE_TAG="v$(BUNDLE_VERSION)" IS_DOWNSTREAM=$(IS_DOWNSTREAM) ./hack/update_fbc.sh
455+
$(OCI_BIN) build $(OCI_BUILD_OPTS) --build-arg CATALOG_PATH="catalog/unreleased/v$(BUNDLE_VERSION)" -f catalog.Dockerfile -t $(CATALOG_IMAGE) .
468456

469457
shortlived-catalog-build: ## Build a temporary catalog image, expiring after 2 weeks on quay
470458
$(MAKE) catalog-build CATALOG_IMAGE=temp-catalog

bundle.Dockerfile.downstream

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG COMMIT
22

33
FROM registry.access.redhat.com/ubi9/python-312 as builder
44

5-
COPY --chown=default . .
5+
COPY --chown=default . .
66
RUN pip install -r requirements.txt
77

88
RUN COMMIT=$COMMIT ./hack/update-build.sh
@@ -14,8 +14,8 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
1414
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
1515
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
1616
LABEL operators.operatorframework.io.bundle.package.v1=netobserv-operator
17-
LABEL operators.operatorframework.io.bundle.channels.v1=latest,community
18-
LABEL operators.operatorframework.io.bundle.channel.default.v1=community
17+
LABEL operators.operatorframework.io.bundle.channels.v1=stable,v1.0.x
18+
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
1919
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.25.3
2020
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
2121
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
@@ -38,10 +38,9 @@ LABEL maintainer="[email protected]"
3838
LABEL io.openshift.tags="network-observability-operator-bundle"
3939
LABEL upstream-vcs-ref="$COMMIT"
4040
LABEL upstream-vcs-type="git"
41-
LABEL description="NetObserv Operator is a Kubernetes / OpenShift operator for network observability."
41+
LABEL description="Network Observability operator for OpenShift."
4242
LABEL distribution-scope=public
4343
LABEL release="1.9.0"
4444
LABEL version="1.9.0"
4545
LABEL url="https://github.com/netobserv/network-observability-operator"
4646
LABEL vendor="Red Hat, Inc."
47-
LABEL description="NetObserv Operator is a Kubernetes / OpenShift operator for network observability."

catalog.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
FROM quay.io/operator-framework/opm:v1.51.0
2+
ARG CATALOG_PATH=catalog
23

34
# Configure the entrypoint and command
45
ENTRYPOINT ["/bin/opm"]
56
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]
67

78
# Copy declarative config root into image at /configs and pre-populate serve cache
8-
ADD catalog /configs
9+
ADD $CATALOG_PATH /configs
910
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]
1011

1112
# Set DC-specific label for the location of the DC root directory

catalog.Dockerfile.downstream

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ ENTRYPOINT ["opm"]
1515
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]
1616

1717
# Copy declarative config root into image at /configs and pre-populate serve cache
18-
COPY --from=builder /opt/app-root/src/catalog /configs/netobserv-operator
18+
COPY --from=builder /opt/app-root/src/catalog/released /configs/netobserv-operator
19+
COPY --from=builder /opt/app-root/src/catalog/unreleased/next/index.yaml /configs/netobserv-operator/
20+
COPY --from=builder /opt/app-root/src/catalog/unreleased/next/bundle.yaml /configs/netobserv-operator/
21+
1922
RUN opm serve /configs --cache-dir=/tmp/cache --cache-only
2023

2124
# Set DC-specific label for the location of the DC root directory
@@ -31,5 +34,5 @@ LABEL maintainer="[email protected]"
3134
LABEL io.openshift.tags="network-observability-operator-catalog"
3235
LABEL upstream-vcs-ref="$COMMIT"
3336
LABEL upstream-vcs-type="git"
34-
LABEL description="NetObserv Operator is a Kubernetes / OpenShift operator for network observability."
37+
LABEL description="Network Observability operator for OpenShift."
3538
LABEL version="1.9.0"

catalog/index.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

catalog/released-legacy/bundles.yaml

Lines changed: 787 additions & 0 deletions
Large diffs are not rendered by default.

catalog/released-legacy/index.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
entries:
2+
- name: network-observability-operator.v1.0.0-202301070345
3+
- name: network-observability-operator.v1.1.0-202302110050
4+
replaces: network-observability-operator.v1.0.0-202301070345
5+
- name: network-observability-operator.v1.2.0
6+
replaces: network-observability-operator.v1.1.0-202302110050
7+
- name: network-observability-operator.v1.3.0
8+
replaces: network-observability-operator.v1.2.0
9+
- name: network-observability-operator.v1.4.0
10+
replaces: network-observability-operator.v1.3.0
11+
- name: network-observability-operator.v1.4.1
12+
replaces: network-observability-operator.v1.4.0
13+
- name: network-observability-operator.v1.4.2
14+
replaces: network-observability-operator.v1.4.1
15+
- name: network-observability-operator.v1.5.0
16+
replaces: network-observability-operator.v1.4.2
17+
- name: network-observability-operator.v1.6.0
18+
replaces: network-observability-operator.v1.5.0
19+
- name: network-observability-operator.v1.6.1
20+
replaces: network-observability-operator.v1.6.0
21+
- name: network-observability-operator.v1.6.2
22+
replaces: network-observability-operator.v1.6.1
23+
- name: network-observability-operator.v1.7.0
24+
replaces: network-observability-operator.v1.6.2
25+
- name: network-observability-operator.v1.8.0
26+
replaces: network-observability-operator.v1.7.0
27+
name: stable
28+
package: netobserv-operator
29+
schema: olm.channel
30+
---
31+
entries:
32+
- name: network-observability-operator.v1.0.0-202301070345
33+
- name: network-observability-operator.v1.1.0-202302110050
34+
replaces: network-observability-operator.v1.0.0-202301070345
35+
- name: network-observability-operator.v1.2.0
36+
replaces: network-observability-operator.v1.1.0-202302110050
37+
- name: network-observability-operator.v1.3.0
38+
replaces: network-observability-operator.v1.2.0
39+
name: v1.0.x
40+
package: netobserv-operator
41+
schema: olm.channel

catalog/released-legacy/other.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
defaultChannel: stable
3+
icon:
4+
base64data: PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93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