Skip to content

Conversation

@simkam
Copy link
Contributor

@simkam simkam commented Jan 28, 2026

fixes https://issues.redhat.com/browse/SRVCOM-4100

Split catalogsource.bash to support both OLMv0 and OLMv1 operator lifecycle management:

  • catalog.bash: Shared utilities (image building, ICSP, mirroring)
  • olmv0_catalog.bash: CatalogSource and Subscription-based installation
  • olmv1_catalog.bash: ClusterCatalog and ClusterExtension-based installation

The OLM_VERSION environment variable (default: v0) controls which installation method is used. OLMv1 introduces ClusterExtension CRs with ServiceAccount-based RBAC instead of OLMv0's Subscriptions.

New OLMv1 configuration variables:

  • OLMV1_CATALOG_NAME, OLMV1_CATALOG_PRIORITY
  • OLMV1_INSTALLER_SA, OLMV1_CLUSTEREXTENSION_NAME
  • OLMV1_UPGRADE_CONSTRAINT_POLICY
  • CATALOGD_NAMESPACE, OPERATOR_CONTROLLER_NAMESPACE

Tests pass locally:

$ echo $OLM_VERSION 
v1
$ make test-e2e-with-kafka

**************************************
***        E2E TESTS PASSED        ***
**************************************

CI (periodic for now) will be added by openshift-knative/hack#857

Code path BEFORE:

  Makefile:dev
  └── hack/dev.sh
      ├── debugging.setup
      ├── create_namespaces (if INSTALL_WITH_ARGO_CD != "true")
      └── ensure_catalogsource_installed              [catalogsource.bash:6-13]
          └── install_catalogsource                   [catalogsource.bash:15-...]
              ├── ensure_catalog_pods_running
              ├── default_serverless_operator_images
              ├── (if CI/DOCKER_REPO_OVERRIDE):
              │   ├── build_image "serverless-bundle"
              │   ├── oc adm policy add-role-to-group (image-puller permissions)
              │   └── build_image "serverless-index"
              ├── (else):
              │   ├── create_image_content_source_policy
              │   └── oc apply (ICSP)
              └── oc apply CatalogSource

  make install

  Makefile:install
  ├── install-tools
  └── hack/install.sh
      ├── debugging.setup
      ├── dump_state.setup
      ├── use_spot_instances
      ├── scale_up_workers
      ├── create_namespaces
      ├── install_certmanager (if INSTALL_CERTMANAGER=true)
      ├── ensure_content_source_policy
      ├── ensure_catalogsource_installed              [catalogsource.bash:6-13]
      │   └── install_catalogsource                   [catalogsource.bash:15-...]
      │       └── (same as above)
      └── ensure_serverless_installed                 [serverless.bash:8-47]
          ├── (check if already installed)
          ├── enable_debug_log
          ├── determine csv version (inline logic)
          ├── remove_installplan (if not CURRENT_CSV)
          ├── deploy_serverless_operator              [serverless.bash:93-117]
          │   ├── oc apply Subscription
          │   └── approve_csv
          │       ├── oc patch subscription
          │       ├── find_install_plan
          │       └── oc patch installplan
          └── install_knative_resources
              ├── deploy_knativeserving_cr
              ├── deploy_knativeeventing_cr
              ├── wait_for_knative_serving_ready
              ├── wait_for_knative_eventing_ready
              ├── deploy_knativekafka_cr (if INSTALL_KAFKA=true)
              └── wait_for_knative_kafka_ready (if INSTALL_KAFKA=true)

Code path AFTER:

  OLM_VERSION=v0 (default)

  make dev

  Makefile:dev
  └── hack/dev.sh
      ├── debugging.setup
      ├── create_namespaces (if INSTALL_WITH_ARGO_CD != "true")
      └── ensure_catalog_installed
          └── ensure_catalogsource_installed          [serverless.bash:112-116]
              └── install_catalogsource               [olmv0_catalog.bash:149-156]
                  ├── ensure_catalog_pods_running
                  ├── default_serverless_operator_images
                  ├── setup_olmv0_image_pull_permissions (if CI/DOCKER_REPO_OVERRIDE)
                  ├── build_bundle_and_index_images (if CI/DOCKER_REPO_OVERRIDE)
                  │   OR apply_icsp_for_konflux_index (if not CI)
                  └── oc apply CatalogSource          [olmv0_catalog.bash:180-190]

  make install

  Makefile:install
  ├── install-tools
  └── hack/install.sh
      ├── debugging.setup
      ├── dump_state.setup
      ├── use_spot_instances
      ├── scale_up_workers
      ├── create_namespaces
      ├── install_certmanager (if INSTALL_CERTMANAGER=true)
      ├── ensure_content_source_policy
      ├── ensure_catalog_installed
      │   └── ensure_catalogsource_installed          [serverless.bash:112-116]
      │       └── install_catalogsource               [olmv0_catalog.bash:149-156]
      │           └── (same as above)
      └── ensure_serverless_installed
          └── ensure_serverless_installed_olmv0       [serverless.bash:82-86]
              ├── check_serverless_already_installed
              ├── enable_debug_log
              ├── determine_csv_version
              ├── remove_installplan (if not CURRENT_CSV)
              ├── deploy_serverless_operator_olmv0    [olmv0_catalog.bash:99-123]
              │   ├── oc apply Subscription
              │   └── approve_csv
              │       ├── oc patch subscription
              │       ├── find_install_plan
              │       └── oc patch installplan
              └── install_knative_resources
                  ├── deploy_knativeserving_cr
                  ├── deploy_knativeeventing_cr
                  ├── wait_for_knative_serving_ready
                  ├── wait_for_knative_eventing_ready
                  ├── deploy_knativekafka_cr (if INSTALL_KAFKA=true)
                  └── wait_for_knative_kafka_ready (if INSTALL_KAFKA=true)

  ---
  OLM_VERSION=v1

  make dev

  Makefile:dev
  └── hack/dev.sh
      ├── debugging.setup
      ├── create_namespaces (if INSTALL_WITH_ARGO_CD != "true")
      └── ensure_catalog_installed
          └── ensure_clustercatalog_installed         [serverless.bash:112-116]
              └── install_clustercatalog              [olmv1_catalog.bash:3-10]
                  ├── default_serverless_operator_images
                  ├── setup_olmv1_image_pull_permissions (if CI/DOCKER_REPO_OVERRIDE)
                  ├── build_bundle_and_index_images (if CI/DOCKER_REPO_OVERRIDE)
                  │   OR apply_icsp_for_konflux_index (if not CI)
                  ├── oc apply ClusterCatalog         [olmv1_catalog.bash:35-47]
                  └── oc wait for ClusterCatalog Serving

  make install

  Makefile:install
  ├── install-tools
  └── hack/install.sh
      ├── debugging.setup
      ├── dump_state.setup
      ├── use_spot_instances
      ├── scale_up_workers
      ├── create_namespaces
      ├── install_certmanager (if INSTALL_CERTMANAGER=true)
      ├── ensure_content_source_policy
      ├── ensure_catalog_installed
      │   └── ensure_clustercatalog_installed         [serverless.bash:112-116]
      │       └── install_clustercatalog              [olmv1_catalog.bash:12-53]
      │           └── (same as above)
      └── ensure_serverless_installed
          └── ensure_serverless_installed_olmv1       [serverless.bash:82-86]
              ├── check_serverless_already_installed
              ├── enable_debug_log
              ├── determine_csv_version
              ├── deploy_serverless_operator_olmv1    [olmv1_catalog.bash:117-151]
              │   ├── setup_olmv1_serviceaccount
              │   │   ├── oc apply ServiceAccount
              │   │   └── oc apply ClusterRoleBinding (cluster-admin)
              │   ├── oc apply ClusterExtension
              │   └── wait_for_clusterextension_ready
              └── install_knative_resources
                  ├── deploy_knativeserving_cr
                  ├── deploy_knativeeventing_cr
                  ├── wait_for_knative_serving_ready
                  ├── wait_for_knative_eventing_ready
                  ├── deploy_knativekafka_cr (if INSTALL_KAFKA=true)
                  └── wait_for_knative_kafka_ready (if INSTALL_KAFKA=true)

Usual note nowadays - written with help from AI - Google Gemini and Claude Code.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 28, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@simkam simkam force-pushed the olmv1 branch 2 times, most recently from 1b9e011 to 9894501 Compare January 29, 2026 16:02
@simkam simkam marked this pull request as ready for review January 30, 2026 14:05
@openshift-ci openshift-ci bot requested review from creydr and matzew January 30, 2026 14:05
@simkam simkam requested review from maschmid and removed request for creydr and matzew January 30, 2026 14:05
@simkam simkam changed the title [WIP][SRVCOM-4100] add OLMv1 support to build scripts [SRVCOM-4100] add OLMv1 support to build scripts Jan 30, 2026
@maschmid
Copy link
Contributor

maschmid commented Feb 4, 2026

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maschmid, simkam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Feb 4, 2026
fixes https://issues.redhat.com/browse/SRVCOM-4100

Split catalogsource.bash to support both OLMv0 and OLMv1 operator lifecycle management:

- catalog.bash: Shared utilities (image building, ICSP, mirroring)
- olmv0_catalog.bash: CatalogSource and Subscription-based installation
- olmv1_catalog.bash: ClusterCatalog and ClusterExtension-based installation

The OLM_VERSION environment variable (default: v0) controls which installation method is used. OLMv1 introduces ClusterExtension CRs with ServiceAccount-based RBAC instead of OLMv0's Subscriptions.

New OLMv1 configuration variables:

- `OLMV1_CATALOG_NAME`, `OLMV1_CATALOG_PRIORITY`
- `OLMV1_INSTALLER_SA`, `OLMV1_CLUSTEREXTENSION_NAME`
- `OLMV1_UPGRADE_CONSTRAINT_POLICY`
- `CATALOGD_NAMESPACE`, `OPERATOR_CONTROLLER_NAMESPACE`

Code path BEFORE:

```
  Makefile:dev
  └── hack/dev.sh
      ├── debugging.setup
      ├── create_namespaces (if INSTALL_WITH_ARGO_CD != "true")
      └── ensure_catalogsource_installed              [catalogsource.bash:6-13]
          └── install_catalogsource                   [catalogsource.bash:15-...]
              ├── ensure_catalog_pods_running
              ├── default_serverless_operator_images
              ├── (if CI/DOCKER_REPO_OVERRIDE):
              │   ├── build_image "serverless-bundle"
              │   ├── oc adm policy add-role-to-group (image-puller permissions)
              │   └── build_image "serverless-index"
              ├── (else):
              │   ├── create_image_content_source_policy
              │   └── oc apply (ICSP)
              └── oc apply CatalogSource

  make install

  Makefile:install
  ├── install-tools
  └── hack/install.sh
      ├── debugging.setup
      ├── dump_state.setup
      ├── use_spot_instances
      ├── scale_up_workers
      ├── create_namespaces
      ├── install_certmanager (if INSTALL_CERTMANAGER=true)
      ├── ensure_content_source_policy
      ├── ensure_catalogsource_installed              [catalogsource.bash:6-13]
      │   └── install_catalogsource                   [catalogsource.bash:15-...]
      │       └── (same as above)
      └── ensure_serverless_installed                 [serverless.bash:8-47]
          ├── (check if already installed)
          ├── enable_debug_log
          ├── determine csv version (inline logic)
          ├── remove_installplan (if not CURRENT_CSV)
          ├── deploy_serverless_operator              [serverless.bash:93-117]
          │   ├── oc apply Subscription
          │   └── approve_csv
          │       ├── oc patch subscription
          │       ├── find_install_plan
          │       └── oc patch installplan
          └── install_knative_resources
              ├── deploy_knativeserving_cr
              ├── deploy_knativeeventing_cr
              ├── wait_for_knative_serving_ready
              ├── wait_for_knative_eventing_ready
              ├── deploy_knativekafka_cr (if INSTALL_KAFKA=true)
              └── wait_for_knative_kafka_ready (if INSTALL_KAFKA=true)
```

Code path AFTER:

```
  OLM_VERSION=v0 (default)

  make dev

  Makefile:dev
  └── hack/dev.sh
      ├── debugging.setup
      ├── create_namespaces (if INSTALL_WITH_ARGO_CD != "true")
      └── ensure_catalog_installed
          └── ensure_catalogsource_installed          [serverless.bash:112-116]
              └── install_catalogsource               [olmv0_catalog.bash:149-156]
                  ├── ensure_catalog_pods_running
                  ├── default_serverless_operator_images
                  ├── setup_olmv0_image_pull_permissions (if CI/DOCKER_REPO_OVERRIDE)
                  ├── build_bundle_and_index_images (if CI/DOCKER_REPO_OVERRIDE)
                  │   OR apply_icsp_for_konflux_index (if not CI)
                  └── oc apply CatalogSource          [olmv0_catalog.bash:180-190]

  make install

  Makefile:install
  ├── install-tools
  └── hack/install.sh
      ├── debugging.setup
      ├── dump_state.setup
      ├── use_spot_instances
      ├── scale_up_workers
      ├── create_namespaces
      ├── install_certmanager (if INSTALL_CERTMANAGER=true)
      ├── ensure_content_source_policy
      ├── ensure_catalog_installed
      │   └── ensure_catalogsource_installed          [serverless.bash:112-116]
      │       └── install_catalogsource               [olmv0_catalog.bash:149-156]
      │           └── (same as above)
      └── ensure_serverless_installed
          └── ensure_serverless_installed_olmv0       [serverless.bash:82-86]
              ├── check_serverless_already_installed
              ├── enable_debug_log
              ├── determine_csv_version
              ├── remove_installplan (if not CURRENT_CSV)
              ├── deploy_serverless_operator_olmv0    [olmv0_catalog.bash:99-123]
              │   ├── oc apply Subscription
              │   └── approve_csv
              │       ├── oc patch subscription
              │       ├── find_install_plan
              │       └── oc patch installplan
              └── install_knative_resources
                  ├── deploy_knativeserving_cr
                  ├── deploy_knativeeventing_cr
                  ├── wait_for_knative_serving_ready
                  ├── wait_for_knative_eventing_ready
                  ├── deploy_knativekafka_cr (if INSTALL_KAFKA=true)
                  └── wait_for_knative_kafka_ready (if INSTALL_KAFKA=true)

  ---
  OLM_VERSION=v1

  make dev

  Makefile:dev
  └── hack/dev.sh
      ├── debugging.setup
      ├── create_namespaces (if INSTALL_WITH_ARGO_CD != "true")
      └── ensure_catalog_installed
          └── ensure_clustercatalog_installed         [serverless.bash:112-116]
              └── install_clustercatalog              [olmv1_catalog.bash:3-10]
                  ├── default_serverless_operator_images
                  ├── setup_olmv1_image_pull_permissions (if CI/DOCKER_REPO_OVERRIDE)
                  ├── build_bundle_and_index_images (if CI/DOCKER_REPO_OVERRIDE)
                  │   OR apply_icsp_for_konflux_index (if not CI)
                  ├── oc apply ClusterCatalog         [olmv1_catalog.bash:35-47]
                  └── oc wait for ClusterCatalog Serving

  make install

  Makefile:install
  ├── install-tools
  └── hack/install.sh
      ├── debugging.setup
      ├── dump_state.setup
      ├── use_spot_instances
      ├── scale_up_workers
      ├── create_namespaces
      ├── install_certmanager (if INSTALL_CERTMANAGER=true)
      ├── ensure_content_source_policy
      ├── ensure_catalog_installed
      │   └── ensure_clustercatalog_installed         [serverless.bash:112-116]
      │       └── install_clustercatalog              [olmv1_catalog.bash:12-53]
      │           └── (same as above)
      └── ensure_serverless_installed
          └── ensure_serverless_installed_olmv1       [serverless.bash:82-86]
              ├── check_serverless_already_installed
              ├── enable_debug_log
              ├── determine_csv_version
              ├── deploy_serverless_operator_olmv1    [olmv1_catalog.bash:117-151]
              │   ├── setup_olmv1_serviceaccount
              │   │   ├── oc apply ServiceAccount
              │   │   └── oc apply ClusterRoleBinding (cluster-admin)
              │   ├── oc apply ClusterExtension
              │   └── wait_for_clusterextension_ready
              └── install_knative_resources
                  ├── deploy_knativeserving_cr
                  ├── deploy_knativeeventing_cr
                  ├── wait_for_knative_serving_ready
                  ├── wait_for_knative_eventing_ready
                  ├── deploy_knativekafka_cr (if INSTALL_KAFKA=true)
                  └── wait_for_knative_kafka_ready (if INSTALL_KAFKA=true)
```
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2026

New changes are detected. LGTM label has been removed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2026

@simkam: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/420-test-upgrade da90930 link true /test 420-test-upgrade
ci/prow/420-images da90930 link true /test 420-images
ci/prow/420-mesh-e2e da90930 link false /test 420-mesh-e2e
ci/prow/420-upstream-e2e da90930 link false /test 420-upstream-e2e
ci/prow/420-mesh-upgrade da90930 link false /test 420-mesh-upgrade
ci/prow/420-kitchensink-e2e da90930 link false /test 420-kitchensink-e2e
ci/prow/420-upstream-e2e-kafka da90930 link false /test 420-upstream-e2e-kafka
ci/prow/420-operator-e2e da90930 link true /test 420-operator-e2e
ci/prow/420-kitchensink-upgrade da90930 link false /test 420-kitchensink-upgrade

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants