Skip to content

Latest commit

 

History

History
48 lines (42 loc) · 2.4 KB

README.md

File metadata and controls

48 lines (42 loc) · 2.4 KB

OLM Bundle Generator

This module accepts the bundle artifacts generated by the operator and sync modules during the package Maven phase. The operator bundle archive contains the initial CSV, CRDs, and K8s (kubernetes.yml) file, whereas the sync bundle only contains a K8s (kubernetes.yml) file. The BundleAssembler class will execute during the Maven package phase when the generate-bundle profile is active and will combine the resources from the given archives, apply any user-supplied JSON patches, and build/push the resulting OLM bundle image. Finally, an OLM bundle index image is generated and pushed using the opm CLI that must be present in the OS PATH.

Configuration Properties

All configuration properties available are documented in the docs for the BundleAssembler.Configs class.

Example Usage

The below example will build the required modules (skipping test execution); build/push the operator and sync application images; generate, build, and push an OLM bundle; and finally build and push an OLM index image. The BUILD_ENGINE environment variable may be one of docker, podman, or buildah.

mvn clean install \
  -Pquickly,generate-bundle \
  -pl api,common,operator,sync,bundle \
  -Dquarkus.container-image.build=true \
  -Dquarkus.container-image.push=true \
  -Dquarkus.container-image.registry=quay.io \
  -Dquarkus.container-image.group=${QUAY_USERNAME} \
  -Dquarkus.container-image.username=${QUAY_USERNAME} \
  -Dquarkus.container-image.password=${QUAY_PASSWORD} \
  -Dquarkus.kubernetes.add-build-timestamp=false \
  -Dquarkus.kubernetes.prometheus.annotations=false \
  -Dkas.bundle.patch='[{
    "op": "add",
    "path": "/spec/install/spec/deployments/0/spec/template/spec/imagePullSecrets",
    "value": [{ "name": "kas-image-pull-secret" }]
  }, {
    "op": "add",
    "path": "/spec/install/spec/deployments/1/spec/template/spec/imagePullSecrets",
    "value": [{ "name": "kas-image-pull-secret" }]
  }]' \
  -Dkas.bundle.credential.docker-config-path=/run/user/$(id -u)/containers/auth.json \
  -Dkas.bundle.image=quay.io/${QUAY_USERNAME}/kas-fleetshard-operator-bundle:latest \
  -Dkas.index.image-registry=quay.io \
  -Dkas.index.image-group=${QUAY_USERNAME} \
  -Dkas.index.image=kas-fleetshard-operator-index \
  -Dkas.index.image-tag=latest \
  -Dkas.index.build-engine=${BUILD_ENGINE:-podman}