Skip to content

Commit

Permalink
build: metalk8s catalog source
Browse files Browse the repository at this point in the history
  • Loading branch information
eg-ayoub committed Dec 26, 2024
1 parent 6ed5594 commit 762ad5e
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buildchain/buildchain/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
UI_BUILD_ROOT: Path = config.BUILD_ROOT / "ui"
# Path to the shell-ui build root directory.
SHELL_UI_BUILD_ROOT: Path = config.BUILD_ROOT / "shell-ui"
# Path to the MetalK8s Catalog Source root directory
CATALOG_SOURCE_ROOT: Path = ROOT / "catalog-source"

# Docker entrypoints.
REDHAT_ENTRYPOINT: Path = ROOT / "packages/redhat/common/entrypoint.sh"
Expand Down
9 changes: 9 additions & 0 deletions buildchain/buildchain/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
constants.OPERATOR_FRAMEWORK_REPOSITORYT: [
"catalogd",
"operator-controller",
"opm"
],
constants.KUBE_BUILDER_REPOSITORY: [
"kube-rbac-proxy",
Expand Down Expand Up @@ -340,6 +341,14 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
dockerfile=constants.NGINX_OPERATOR_ROOT / "bundle.Dockerfile",
build_context=constants.NGINX_OPERATOR_ROOT,
),
_local_image(
name="metalk8s-catalog-source",
dockerfile=constants.CATALOG_SOURCE_ROOT / "catalog.Dockerfile",
build_context=constants.CATALOG_SOURCE_ROOT,
build_args={
"BASE_IMG": TO_PULL["opm"].remote_fullname_digest,
},
),
)
# }}}

Expand Down
10 changes: 10 additions & 0 deletions buildchain/buildchain/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
version=_version_prefix(NGINX_OPERATOR_VERSION),
digest=None,
),
Image(
name="opm",
version="v1.49.0",
digest="sha256:0bbe4054f2f88410ae364169379639c06b0e253d6e233bc24fcf2c0cd2d9803d",
),
Image(
name="metalk8s-catalog-source",
version=VERSION,
digest=None,
),
Image(
name="loki",
version="3.2.0",
Expand Down
2 changes: 2 additions & 0 deletions catalog-source/.indexignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
README.md
*.Dockerfile
5 changes: 5 additions & 0 deletions catalog-source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MetalK8s catalog source for OLMv1

contains the current operators:

- MetalK8s [nginx-operator](../nginx-operator)
23 changes: 23 additions & 0 deletions catalog-source/catalog.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG BASE_IMG=quay.io/operator-framework/opm:latest
# The builder image is expected to contain
# /bin/opm (with serve subcommand)
FROM ${BASE_IMG} as builder

# Copy FBC root into image at /configs and pre-populate serve cache
ADD catalog /configs
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

FROM ${BASE_IMG}
# The base image is expected to contain
# /bin/opm (with serve subcommand) and /bin/grpc_health_probe

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

COPY --from=builder /configs /configs
COPY --from=builder /tmp/cache /tmp/cache

# Set FBC-specific label for the location of the FBC root directory
# in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
1 change: 1 addition & 0 deletions catalog-source/catalog/.indexignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
38 changes: 38 additions & 0 deletions catalog-source/catalog/nginx-operator/bundles/v4.11.3.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions catalog-source/catalog/nginx-operator/channels/stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
schema: olm.channel
package: nginx-operator
name: stable
entries:
- name: nginx-operator.v4.11.3
8 changes: 8 additions & 0 deletions catalog-source/catalog/nginx-operator/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
defaultChannel: stable
description: |
# NGINX-operator
This operator manages IngressNginx CRs and uses them as a values file for the [ingress-nginx](https://github.com/kubernetes/ingress-nginx) helm chart.
name: nginx-operator
schema: olm.package

0 comments on commit 762ad5e

Please sign in to comment.