Skip to content

Add medik8s-operator-subscribe Prow step for OLM operator installation#79547

Open
ugreener wants to merge 1 commit into
openshift:mainfrom
ugreener:rhwa-operator-subscribe
Open

Add medik8s-operator-subscribe Prow step for OLM operator installation#79547
ugreener wants to merge 1 commit into
openshift:mainfrom
ugreener:rhwa-operator-subscribe

Conversation

@ugreener
Copy link
Copy Markdown
Contributor

@ugreener ugreener commented May 20, 2026

Summary

Adds a reusable Prow step medik8s-operator-subscribe that installs medik8s/RHWA operators via OLM Subscription from an existing CatalogSource. Designed to run after the medik8s-catalogsource step (PR #79373).

What this step does

  1. Creates namespace openshift-workload-availability with privileged PSA labels
  2. Creates OperatorGroup (validates no conflicting OGs exist)
  3. For each operator in OPERATORS (comma-separated): verifies PackageManifest exists, creates Subscription
  4. Waits for all CSVs to reach Succeeded phase (10m timeout per operator)
  5. Dumps comprehensive debug info on failure (Subscription, InstallPlan, events)

Design pattern

Based on the proven cert-manager-install-operator step (used by 33+ nightly configs). Key additions:

  • Multi-operator support via comma-separated OPERATORS env var
  • Reads CatalogSource name from ${SHARED_DIR}/catsrc_name for step chaining
  • Multiple OperatorGroup validation (fails fast on >1 OG, matching optional-operators-subscribe behavior)

Files

ci-operator/step-registry/medik8s/operator-subscribe/
├── OWNERS
├── medik8s-operator-subscribe-commands.sh
├── medik8s-operator-subscribe-ref.metadata.json
└── medik8s-operator-subscribe-ref.yaml

Test plan

  • Rehearsal jobs pass (YAML, metadata, OWNERS validation)
  • Step is visible in step registry after merge
  • Downstream: will be used by periodic job configs (RHWA-1022, RHWA-1023)

Jira: RHWA-1021

Summary by CodeRabbit

This PR adds a reusable OpenShift CI Prow step, medik8s-operator-subscribe, to the ci-operator step registry to automate installation of medik8s / RHWA operators via OLM Subscriptions in CI clusters. The step is intended to follow the medik8s-catalogsource step and consume a CatalogSource produced there.

What changed and practical impact on CI/infrastructure:

  • New step implementation script: ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh
    • Reads environment parameters (OPERATORS, CATALOG_SOURCE_NAME, OO_CHANNEL, INSTALL_NAMESPACE) and optionally sources proxy config from ${SHARED_DIR}/proxy-conf.sh.
    • Reads CatalogSource name from ${SHARED_DIR}/catsrc_name if present to chain to the catalogsource step.
    • Creates the install namespace (default openshift-workload-availability) and applies privileged PodSecurity labels.
    • Validates OperatorGroup state (fails if >1 OperatorGroup would conflict) and creates a single OperatorGroup if absent.
    • Supports installing multiple operators via a comma-separated OPERATORS list: for each operator it waits for a PackageManifest (filtered by catalog label), creates an Automatic-install Subscription (from openshift-marketplace, source = CATALOG_SOURCE_NAME), polls for status.installedCSV, and waits for the CSV to reach Succeeded (10 minute CSV timeout; 5 minute wait for phase).
    • Emits comprehensive debug info (Subscription YAML, InstallPlans, recent events, CSV YAML) on failures and exits nonzero; on success lists installed CSVs.
    • Exposes a main() entrypoint invoked by the step.
  • Step reference: ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.yaml
    • Wires the script into the step registry (ref: medik8s-operator-subscribe), sets a 10m container grace period, CPU/memory requests, and documents parameterized env vars and behavior.
  • Registry metadata and ownership: ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json and OWNERS
    • Add approvers/reviewers: beekhof, clobrano, maximunited, mshitrit, razo7, slintes, ugreener.

Design notes and compatibility:

  • Patterned on the existing cert-manager-install-operator step and mirrors OperatorGroup validation used by optional-operators-subscribe.
  • Enables multi-operator installation and explicit chaining to a preceding catalogsource step via ${SHARED_DIR}/catsrc_name.

Next steps / downstream impact:

  • Rehearsal jobs must pass (YAML, metadata, OWNERS validation) for the step to be visible in the registry.
  • Downstream CI job configs (e.g., RHWA periodic jobs) can reference this step to install and verify medik8s/RHWA operators in CI clusters.

@ugreener
Copy link
Copy Markdown
Contributor Author

/pj-rehearse auto-ack

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@ugreener: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 05c01939-60ae-48c7-a774-eb677a067a30

📥 Commits

Reviewing files that changed from the base of the PR and between 2f60ff6 and 7acfaa2.

📒 Files selected for processing (4)
  • ci-operator/step-registry/medik8s/operator-subscribe/OWNERS
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.yaml
✅ Files skipped from review due to trivial changes (1)
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json

Walkthrough

Adds a ci-operator step medik8s-operator-subscribe: OWNERS and metadata, a step YAML exposing env vars and resources, and a Bash script that creates namespace/OperatorGroup, creates Subscriptions for listed operators, and waits for CSVs to reach Succeeded.

Changes

medik8s-operator-subscribe CI Step

Layer / File(s) Summary
Step definition, metadata, and ownership
ci-operator/step-registry/medik8s/operator-subscribe/OWNERS, ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json, ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.yaml
Adds OWNERS with approvers/reviewers, step metadata linking the YAML, and the step YAML that defines env vars (OPERATORS, CATALOG_SOURCE_NAME, OO_CHANNEL, INSTALL_NAMESPACE), resource requests, and execution settings.
Script helpers and polling
ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh
Adds strict-mode script, set_proxy, ensure_namespace, ensure_operatorgroup, wait_for_package_manifest, create_subscription, and wait_for_csv including polling and failure diagnostics.
Main orchestration and entrypoint
ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh
Adds main() to parse OPERATORS, optionally override catalog source, ensure prerequisites, create Subscriptions for each package, wait for CSV success, and invoke main at file end.

Sequence Diagram

sequenceDiagram
  participant CI_Script as medik8s-operator-subscribe.sh
  participant SharedDir
  participant openshift_marketplace
  participant ClusterAPI as oc/Kubernetes
  CI_Script->>SharedDir: read proxy conf / catsrc_name (optional)
  CI_Script->>ClusterAPI: oc apply namespace + OperatorGroup
  CI_Script->>openshift_marketplace: poll PackageManifest for package (catalog label)
  CI_Script->>ClusterAPI: oc apply Subscription (sourceNamespace: openshift-marketplace)
  CI_Script->>ClusterAPI: poll Subscription -> installedCSV
  CI_Script->>ClusterAPI: oc wait CSV conditions -> Succeeded (or emit diagnostics)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

lgtm, jira/valid-reference

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a reusable Prow step for OLM operator installation, which matches the core objective of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR contains no Ginkgo test files; the check for stable test names does not apply to CI/CD configuration files (Bash scripts, YAML, JSON, OWNERS).
Test Structure And Quality ✅ Passed This PR adds CI/CD step registry definitions and helper scripts, not Ginkgo test code. The check is not applicable.
Microshift Test Compatibility ✅ Passed PR adds Prow CI infrastructure (Bash script and YAML configs), not Ginkgo e2e tests. MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. The PR adds CI infrastructure (Prow step definition, Bash script, metadata) for operator installation, which is outside the scope of SNO compatibility checks.
Topology-Aware Scheduling Compatibility ✅ Passed This PR adds a Prow CI step for OLM operator installation. No topology-aware scheduling constraints are introduced in any of the added files.
Ote Binary Stdout Contract ✅ Passed This PR adds a Bash Prow step script, not a Go OTE binary. The OTE Binary Stdout Contract applies only to OpenShift Tests Extension binaries, not CI step scripts.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds no Ginkgo e2e tests—only Bash scripts, YAML/JSON configs for a Prow step. The custom check applies only to Ginkgo tests, so it is not applicable here.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from petr-muller and sosiouxme May 20, 2026 15:45
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ugreener

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 Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2026
@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label May 20, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@ugreener: no rehearsable tests are affected by this change

@ugreener ugreener force-pushed the rhwa-operator-subscribe branch from 017c405 to baca569 Compare May 20, 2026 16:02
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh`:
- Around line 137-141: The check only verifies OPERATORS is non-empty but not
that it yields any valid package names after splitting/trimming; update the
validation so after you parse/sanitize OPERATORS (the code that splits on commas
and trims entries around the parsing loop at the block handling OPERATORS
parsing — references: the OPERATORS variable and the parsing logic around lines
that iterate over entries), count non-empty package names and, if that count is
zero, print the same ERROR/Example messages and exit 1; apply the same
validation to the second parsing area mentioned (the other block handling
OPERATORS parsing) so the step fails fast when parsing yields no valid packages.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: aa239257-d6a2-49b6-8f76-8fdbad9346a3

📥 Commits

Reviewing files that changed from the base of the PR and between 017c405 and baca569.

📒 Files selected for processing (4)
  • ci-operator/step-registry/medik8s/operator-subscribe/OWNERS
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.yaml
✅ Files skipped from review due to trivial changes (1)
  • ci-operator/step-registry/medik8s/operator-subscribe/OWNERS

@ugreener ugreener force-pushed the rhwa-operator-subscribe branch from baca569 to 157f949 Compare May 20, 2026 16:19
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh`:
- Around line 96-130: The function wait_for_csv currently waits up to 10m to see
.status.installedCSV and then an additional fixed 5m for the CSV to reach
Succeeded, allowing ~15m total; change the first polling loop (in wait_for_csv)
to only wait 5 minutes (e.g., reduce seq 1 60 to seq 1 30 with the same 10s
sleep) so the initial installedCSV wait is 5m and the subsequent oc wait
--timeout=5m keeps the per-operator end-to-end timeout to 10m; update the
user-facing attempt message if needed to match the new attempt count.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 30e3fcaf-728f-42ba-bd2e-29cf95ca4c9f

📥 Commits

Reviewing files that changed from the base of the PR and between baca569 and 157f949.

📒 Files selected for processing (4)
  • ci-operator/step-registry/medik8s/operator-subscribe/OWNERS
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-commands.sh
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.yaml
✅ Files skipped from review due to trivial changes (2)
  • ci-operator/step-registry/medik8s/operator-subscribe/OWNERS
  • ci-operator/step-registry/medik8s/operator-subscribe/medik8s-operator-subscribe-ref.metadata.json

@ugreener ugreener force-pushed the rhwa-operator-subscribe branch from 157f949 to 2f60ff6 Compare May 21, 2026 06:11
Creates a reusable step that installs medik8s/RHWA operators via OLM
Subscription from an existing CatalogSource. Supports installing
multiple operators in a single step via comma-separated OPERATORS env var.

Based on the cert-manager-install-operator pattern: verifies PackageManifest
availability, creates Namespace + OperatorGroup + Subscriptions, waits for
CSVs to reach Succeeded phase with comprehensive debug output on failure.

Jira: RHWA-1021

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ugreener ugreener force-pushed the rhwa-operator-subscribe branch from 2f60ff6 to 7acfaa2 Compare May 21, 2026 09:30
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@ugreener: no rehearsable tests are affected by this change

Note: If this PR includes changes to step registry files (ci-operator/step-registry/) and you expected jobs to be found, try rebasing your PR onto the base branch. This helps pj-rehearse accurately detect changes when the base branch has moved forward.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

@ugreener: The following test 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/owners 7acfaa2 link true /test owners

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant