Skip to content

Commit 762ad5e

Browse files
committed
build: metalk8s catalog source
1 parent 6ed5594 commit 762ad5e

File tree

10 files changed

+104
-0
lines changed

10 files changed

+104
-0
lines changed

buildchain/buildchain/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
UI_BUILD_ROOT: Path = config.BUILD_ROOT / "ui"
7575
# Path to the shell-ui build root directory.
7676
SHELL_UI_BUILD_ROOT: Path = config.BUILD_ROOT / "shell-ui"
77+
# Path to the MetalK8s Catalog Source root directory
78+
CATALOG_SOURCE_ROOT: Path = ROOT / "catalog-source"
7779

7880
# Docker entrypoints.
7981
REDHAT_ENTRYPOINT: Path = ROOT / "packages/redhat/common/entrypoint.sh"

buildchain/buildchain/image.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
220220
constants.OPERATOR_FRAMEWORK_REPOSITORYT: [
221221
"catalogd",
222222
"operator-controller",
223+
"opm"
223224
],
224225
constants.KUBE_BUILDER_REPOSITORY: [
225226
"kube-rbac-proxy",
@@ -340,6 +341,14 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
340341
dockerfile=constants.NGINX_OPERATOR_ROOT / "bundle.Dockerfile",
341342
build_context=constants.NGINX_OPERATOR_ROOT,
342343
),
344+
_local_image(
345+
name="metalk8s-catalog-source",
346+
dockerfile=constants.CATALOG_SOURCE_ROOT / "catalog.Dockerfile",
347+
build_context=constants.CATALOG_SOURCE_ROOT,
348+
build_args={
349+
"BASE_IMG": TO_PULL["opm"].remote_fullname_digest,
350+
},
351+
),
343352
)
344353
# }}}
345354

buildchain/buildchain/versions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,16 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
294294
version=_version_prefix(NGINX_OPERATOR_VERSION),
295295
digest=None,
296296
),
297+
Image(
298+
name="opm",
299+
version="v1.49.0",
300+
digest="sha256:0bbe4054f2f88410ae364169379639c06b0e253d6e233bc24fcf2c0cd2d9803d",
301+
),
302+
Image(
303+
name="metalk8s-catalog-source",
304+
version=VERSION,
305+
digest=None,
306+
),
297307
Image(
298308
name="loki",
299309
version="3.2.0",

catalog-source/.indexignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README.md
2+
*.Dockerfile

catalog-source/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# MetalK8s catalog source for OLMv1
2+
3+
contains the current operators:
4+
5+
- MetalK8s [nginx-operator](../nginx-operator)

catalog-source/catalog.Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG BASE_IMG=quay.io/operator-framework/opm:latest
2+
# The builder image is expected to contain
3+
# /bin/opm (with serve subcommand)
4+
FROM ${BASE_IMG} as builder
5+
6+
# Copy FBC root into image at /configs and pre-populate serve cache
7+
ADD catalog /configs
8+
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]
9+
10+
FROM ${BASE_IMG}
11+
# The base image is expected to contain
12+
# /bin/opm (with serve subcommand) and /bin/grpc_health_probe
13+
14+
# Configure the entrypoint and command
15+
ENTRYPOINT ["/bin/opm"]
16+
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]
17+
18+
COPY --from=builder /configs /configs
19+
COPY --from=builder /tmp/cache /tmp/cache
20+
21+
# Set FBC-specific label for the location of the FBC root directory
22+
# in the image
23+
LABEL operators.operatorframework.io.index.configs.v1=/configs

catalog-source/catalog/.indexignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md

catalog-source/catalog/nginx-operator/bundles/v4.11.3.yaml

Lines changed: 38 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
schema: olm.channel
3+
package: nginx-operator
4+
name: stable
5+
entries:
6+
- name: nginx-operator.v4.11.3
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
defaultChannel: stable
3+
description: |
4+
# NGINX-operator
5+
6+
This operator manages IngressNginx CRs and uses them as a values file for the [ingress-nginx](https://github.com/kubernetes/ingress-nginx) helm chart.
7+
name: nginx-operator
8+
schema: olm.package

0 commit comments

Comments
 (0)