Skip to content

Commit 30e832d

Browse files
committed
Introduce 'run-opm-command' in the fbc pipeline
1 parent 7bffb1b commit 30e832d

File tree

3 files changed

+34
-39
lines changed

3 files changed

+34
-39
lines changed

.konflux/Dockerfile.catalog

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,5 @@
11
# The opm image is expected to contain /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
22
ARG OPM_IMAGE=registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.18
3-
ARG BUILDER_IMAGE=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23
4-
5-
# build the catalog
6-
FROM ${BUILDER_IMAGE} AS builder
7-
8-
# create dir structure to generate the catalog
9-
RUN mkdir -p /app/hack /app/.konflux/catalog
10-
COPY Makefile /app
11-
COPY .konflux/catalog/ /app/.konflux/catalog/
12-
COPY telco5g-konflux /app/telco5g-konflux
13-
14-
# we need to copy the vendor/ folder as the Makefile depends on it
15-
COPY vendor/ /app/vendor/
16-
17-
# generate the catalog
18-
19-
# debug
20-
RUN echo "root dir" && ls -lra $HOME
21-
22-
WORKDIR /app
23-
RUN --mount=type=secret,id=telco-5g-redhat-pull-secret/.dockerconfigjson \
24-
mkdir -p $HOME/.docker/ && \
25-
cp /run/secrets/telco-5g-redhat-pull-secret/.dockerconfigjson $HOME/.docker/config.json
26-
27-
# debug
28-
RUN echo "run secrets" && ls -lra /run/secrets/ && echo "docker dir" && ls -lra $HOME/.docker/ && cat $HOME/.docker/config.json
29-
30-
ENV REGISTRY_AUTH_FILE=$HOME/.docker/config.json
31-
32-
# The Konflux build is not hermetic so it will download the tools (opm, yq, etc) automatically
33-
# Konflux will externally sync the submodules so we can skip it here
34-
RUN SKIP_SUBMODULE_SYNC=yes make konflux-generate-catalog-production && \
35-
rm -f $HOME/.docker/config.json
36-
373
# run the catalog
384
FROM ${OPM_IMAGE}
395

@@ -43,7 +9,7 @@ CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]
439
# ensure this correponds to olm.package name
4410
ENV PACKAGE_NAME=topology-aware-lifecycle-manager
4511

46-
COPY --from=builder /app/.konflux/catalog/$PACKAGE_NAME/ /configs/$PACKAGE_NAME
12+
COPY .konflux/catalog/$PACKAGE_NAME/ /configs/$PACKAGE_NAME
4713
# RUN ["/bin/opm", "validate", "/configs/topology-aware-lifecycle-manager"]
4814
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]
4915

.konflux/catalog/catalog-template.in.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ entries:
4646
- image: registry.redhat.io/openshift4/topology-aware-lifecycle-manager-operator-bundle:v4.18.1
4747
schema: olm.bundle
4848
# v4.18.2 bundle
49-
# The url for this last entry is updated by telco5g-konflux/scripts/catalog/update-catalog-template.sh automatically
50-
- image: placeholder.will.be.updated.by.telco5g-konflux.scripts.catalog.update-catalog-template.sh
49+
# Setting the image here for now, bypassing the previous bundle.builds.in.yaml logic
50+
- image: quay.io/redhat-user-workloads/telco-5g-tenant/topology-aware-lifecycle-manager-bundle-4-18@sha256:f4e7d4192987460413b8c1c71b62cd09a1e8951a1721c08e550efc2ea5e85af5
5151
schema: olm.bundle
5252
schema: olm.template.basic

.tekton/fbc-pipeline.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,47 @@ spec:
148148
workspaces:
149149
- name: basic-auth
150150
workspace: git-auth
151+
- name: run-opm-command
152+
params:
153+
- name: SOURCE_ARTIFACT
154+
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
155+
- name: ociStorage
156+
value: $(params.output-image).opm
157+
- name: ociArtifactExpiresAfter
158+
value: $(params.image-expires-after)
159+
- name: OPM_ARGS
160+
value:
161+
- alpha
162+
- render-template
163+
- basic
164+
# arg for OCP 4.17 and newer
165+
- "--migrate-level=bundle-object-to-csv-metadata"
166+
- ".konflux/catalog/catalog-template.in.yaml"
167+
- name: OPM_OUTPUT_PATH
168+
value: ".konflux/catalog/topology-aware-lifecycle-manager/catalog.json"
169+
runAfter:
170+
- clone-repository
171+
taskRef:
172+
params:
173+
- name: name
174+
value: run-opm-command-oci-ta
175+
- name: bundle
176+
value: quay.io/konflux-ci/tekton-catalog/task-run-opm-command-oci-ta:0.1@sha256:4ab5dba35166a976c3d6293913501fdfc79a3222395388fc6208641ab8bc9359
177+
- name: kind
178+
value: task
179+
resolver: bundles
151180
- name: prefetch-dependencies
152181
params:
153182
- name: input
154183
value: $(params.prefetch-input)
155184
- name: SOURCE_ARTIFACT
156-
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
185+
value: $(tasks.run-opm-command.SOURCE_ARTIFACT)
157186
- name: ociStorage
158187
value: $(params.output-image).prefetch
159188
- name: ociArtifactExpiresAfter
160189
value: $(params.image-expires-after)
161190
runAfter:
162-
- clone-repository
191+
- run-opm-command
163192
taskRef:
164193
params:
165194
- name: name

0 commit comments

Comments
 (0)