Skip to content

OPRUN-4571: add OLMv1 topology-based deployment scaling e2e test#737

Open
tmshort wants to merge 1 commit into
openshift:mainfrom
tmshort:test-replicas
Open

OPRUN-4571: add OLMv1 topology-based deployment scaling e2e test#737
tmshort wants to merge 1 commit into
openshift:mainfrom
tmshort:test-replicas

Conversation

@tmshort
Copy link
Copy Markdown
Contributor

@tmshort tmshort commented May 26, 2026

Adds a new test that verifies cluster-olm-operator correctly configures operator-controller and catalogd deployments based on the cluster's control plane topology:

  • HA topologies (HighlyAvailable, HighlyAvailableArbiter, DualReplica): replicas=2 with a PodDisruptionBudget present
  • Non-HA topologies (SingleReplica/SNO, External): replicas=1, no PDB

Also registers policyv1 in the test scheme to support PDB list queries.

Summary by CodeRabbit

  • Tests

    • Added OLMv1 topology-based scaling tests to validate replica counts and PodDisruptionBudget presence across HA and non-HA control-plane topologies.
    • Added a new blocking test payload entry for the OLMv1 topology-based scaling scenario.
  • Chores

    • Test environment updated to recognize policy API group resources for test clients.
    • Updated embedded test asset metadata timestamps in generated bundles.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 26, 2026

@tmshort: This pull request references OPRUN-4571 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Adds a new test that verifies cluster-olm-operator correctly configures operator-controller and catalogd deployments based on the cluster's control plane topology:

  • HA topologies (HighlyAvailable, HighlyAvailableArbiter, DualReplica): replicas=2 with a PodDisruptionBudget present
  • Non-HA topologies (SingleReplica/SNO, External): replicas=1, no PDB

Also registers policyv1 in the test scheme to support PDB list queries.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 26, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cf5a189a-9f8b-43d1-a940-9bea627eb3fb

📥 Commits

Reviewing files that changed from the base of the PR and between 1002531 and 215a72c.

📒 Files selected for processing (9)
  • openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json
  • openshift/tests-extension/pkg/bindata/catalog/catalog.go
  • openshift/tests-extension/pkg/bindata/operator/operator.go
  • openshift/tests-extension/pkg/bindata/singleown/bundle/bundle.go
  • openshift/tests-extension/pkg/bindata/singleown/index/index.go
  • openshift/tests-extension/pkg/bindata/webhook/bundle/bundle.go
  • openshift/tests-extension/pkg/bindata/webhook/index/index.go
  • openshift/tests-extension/pkg/env/cluster.go
  • openshift/tests-extension/test/olmv1-topology.go
✅ Files skipped from review due to trivial changes (7)
  • openshift/tests-extension/pkg/env/cluster.go
  • openshift/tests-extension/pkg/bindata/webhook/index/index.go
  • openshift/tests-extension/pkg/bindata/webhook/bundle/bundle.go
  • openshift/tests-extension/pkg/bindata/singleown/index/index.go
  • openshift/tests-extension/pkg/bindata/catalog/catalog.go
  • openshift/tests-extension/pkg/bindata/operator/operator.go
  • openshift/tests-extension/pkg/bindata/singleown/bundle/bundle.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json
  • openshift/tests-extension/test/olmv1-topology.go

Walkthrough

Imports Kubernetes policy/v1 into the test environment scheme, adds an OLMv1 topology-aware Ginkgo test that validates operand Deployment replicas and PodDisruptionBudgets by controlPlaneTopology, registers the new test in payload JSON, and updates generated bindata embedded modTime timestamps.

Changes

OLMv1 Topology-based Scaling Tests

Layer / File(s) Summary
Test environment policy/v1 scheme support
openshift/tests-extension/pkg/env/cluster.go
Import and register the policy/v1 API group into the controller-runtime scheme used by the test environment.
OLMv1 topology-aware test definitions
openshift/tests-extension/test/olmv1-topology.go
Adds package-local operand definitions, Ginkgo suite registration, and a BeforeEach guard requiring OLMv1 capability.
OLMv1 topology assertions (replicas & PDBs)
openshift/tests-extension/test/olmv1-topology.go
Reads Infrastructure controlPlaneTopology, classifies HA vs non-HA, validates operand Deployment spec.replicas (2 for HA, nil/1 for non-HA), and checks PodDisruptionBudget presence matches topology.
Test payload registration
openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json
Adds a payload JSON entry registering the new OLMv1 topology-based deployment scaling test case.
Generated bindata timestamp updates
openshift/tests-extension/pkg/bindata/...
Updates embedded bindataFileInfo.modTime timestamps in generated go-bindata files for multiple bundles and indexes; asset bytes and access APIs unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

lgtm, qe-approved, verified

Suggested reviewers

  • bentito
🚥 Pre-merge checks | ✅ 12 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Test lacks meaningful failure messages on two assertions: line 48 (Get Infrastructure) and line 82 (List PodDisruptionBudgets) use .To(Succeed()) without messages. Add meaningful failure messages to both assertions: line 48 should explain getting the cluster Infrastructure resource failed, and line 82 should explain listing PodDisruptionBudgets failed.
Microshift Test Compatibility ⚠️ Warning Test uses config.openshift.io APIs (Infrastructure, ClusterVersion) unavailable on MicroShift with no protection mechanism against running on MicroShift. Add [apigroup:config.openshift.io] tag to Describe, or [Skipped:MicroShift] label, or guard with exutil.IsMicroShiftCluster() check.
✅ Passed checks (12 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 describes the main change: adding an OLMv1 topology-based deployment scaling end-to-end test, which aligns with the primary code additions in 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 Describe and It test names are static with no dynamic content. By() statements use fmt.Sprintf but are test body progress reports, not test titles.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Test correctly handles all topology modes including SNO via runtime topology detection; no multi-node assumptions; validates appropriate replica counts and PDB behavior for SingleReplicaTopologyMode.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds E2E test validating topology-aware deployment scaling. It checks ControlPlaneTopology and asserts correct replica and PDB configs for each topology.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes detected. All logging uses GinkgoWriter (not stdout). Test code contained in test blocks. No fmt.Print, klog, or unredirected log violations found.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Test performs cluster-internal operations only: topology enum reading, numeric replica checks, and label-based PDB filtering. No IPv4 addresses, IP parsing, or external connectivity present.
No-Weak-Crypto ✅ Passed No weak cryptographic patterns detected. Changes only add Kubernetes API imports, test code for deployment topology validation, and auto-generated bindata timestamp updates.
Container-Privileges ✅ Passed PR adds an e2e test and policyv1 schema registration; no privileged containers, hostPID/Network/IPC, SYS_ADMIN, allowPrivilegeEscalation, or root-as-user settings found.
No-Sensitive-Data-In-Logs ✅ Passed Logging statements only expose non-sensitive information: error messages, version numbers, file paths, and cluster topology/deployment names. No credentials or PII found.

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

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

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

@openshift-ci openshift-ci Bot requested review from bentito and dtfranz May 26, 2026 19:45
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 26, 2026
Copy link
Copy Markdown

@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 `@openshift/tests-extension/test/olmv1-topology.go`:
- Around line 79-87: The current check lists all PodDisruptionBudgets (pdbList
:= &policyv1.PodDisruptionBudgetList{}; k8sClient.List(...,
client.InNamespace(c.namespace))) and asserts emptiness based on isHA, which is
too broad; instead scope PDB assertions to only those PDBs that target the
current deployment’s pods by using the deployment’s label set (e.g., the labels
used by the Deployment referenced by this test) as a selector when listing or by
filtering pdbList.Items by comparing each pdb.Spec.Selector
(MatchLabels/MatchExpressions) against the deployment labels; update the
k8sClient.List call or add a filter step so the Expect checks (the isHA branch)
only consider PDBs that select the deployment’s pods (referencing pdbList,
policyv1.PodDisruptionBudgetList, k8sClient.List, c.namespace, isHA, and the
test’s deployment labels).
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 395a5019-d7ab-42d6-b359-fc1f67a85f1f

📥 Commits

Reviewing files that changed from the base of the PR and between 3d91cab and 69aa412.

📒 Files selected for processing (2)
  • openshift/tests-extension/pkg/env/cluster.go
  • openshift/tests-extension/test/olmv1-topology.go

Comment thread openshift/tests-extension/test/olmv1-topology.go Outdated
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2026
@camilamacedo86
Copy link
Copy Markdown
Contributor

It seems fine /lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, tmshort

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

@camilamacedo86
Copy link
Copy Markdown
Contributor

/lgtm cancel

I think we need to run the tests manually first to ensure that has no flakes
See: https://github.com/openshift/operator-framework-operator-controller/blob/main/openshift/tests-extension/README.md#development-workflow

With /payload-aggregate

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 27, 2026
Adds a new test that verifies cluster-olm-operator correctly configures
operator-controller and catalogd deployments based on the cluster's
control plane topology:
- HA topologies (HighlyAvailable, HighlyAvailableArbiter, DualReplica):
  replicas=2 with a PodDisruptionBudget present
- Non-HA topologies (SingleReplica/SNO, External): replicas=1, no PDB

Also registers policyv1 in the test scheme to support PDB list queries.

Assisted-by: claude
Signed-off-by: Todd Short <tshort@redhat.com>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

@tmshort: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

@tmshort
Copy link
Copy Markdown
Contributor Author

tmshort commented May 27, 2026

/payload-aggregate periodic-ci-openshift-release-master-ci-4.23-e2e-gcp-ovn-techpreview 5

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

@tmshort: trigger 0 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

@tmshort
Copy link
Copy Markdown
Contributor Author

tmshort commented May 27, 2026

/payload-aggregate periodic-ci-openshift-release-main-ci-4.23-e2e-gcp-ovn-techpreview 5

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

@tmshort: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.23-e2e-gcp-ovn-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/6a85cb70-59d7-11f1-9a81-4ef5e34f3614-0

Copy link
Copy Markdown
Contributor

@ankitathomas ankitathomas left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2026
@tmshort
Copy link
Copy Markdown
Contributor Author

tmshort commented May 27, 2026

/hold
On the payload-aggregate

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

@tmshort: all tests passed!

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.

@Leo6Leo
Copy link
Copy Markdown

Leo6Leo commented May 27, 2026

/verified by @Leo6Leo

Manual cluster verification (HA cluster, OCP 5.0 nightly)

  • Confirmed NewOLM feature gate is enabled.
  • Verified operator-controller-controller-manager has 2 replicas.
  • Verified catalogd-controller-manager has 2 replicas.
  • Verified PDBs exist in both namespaces and their selectors match the deployment pod labels.

Built and ran the new e2e test

  • Built the test binary via make build-local-dev.
  • Ran the test — passed on the HA cluster in 0.156s.

Per @tmshort 's guidance, this verify is conditional on the payload-aggregate: if payload-aggregate job succeeds link to payload, then it should be good.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 27, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@Leo6Leo: This PR has been marked as verified by @Leo6Leo.

Details

In response to this:

/verified by @Leo6Leo

Manual cluster verification (HA cluster, OCP 5.0 nightly)

  • Confirmed NewOLM feature gate is enabled.
  • Verified operator-controller-controller-manager has 2 replicas.
  • Verified catalogd-controller-manager has 2 replicas.
  • Verified PDBs exist in both namespaces and their selectors match the deployment pod labels.

Built and ran the new e2e test

  • Built the test binary via make build-local-dev.
  • Ran the test — passed on the HA cluster in 0.156s.

Per @tmshort 's guidance, this verify is conditional on the payload-aggregate: if payload-aggregate job succeeds link to payload, then it should be good.

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 openshift-eng/jira-lifecycle-plugin repository.

@tmshort
Copy link
Copy Markdown
Contributor Author

tmshort commented May 27, 2026

/payload-aggregate periodic-ci-openshift-release-main-ci-4.23-e2e-gcp-ovn-techpreview 5

On the first attempt, it appears that the aggregator failed (the jobs rand and finished, but results were not aggregated). I'll take a look at the individual jobs to verify it. But also, will run it again (just in case).

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 27, 2026

@tmshort: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.23-e2e-gcp-ovn-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/810c4620-5a1e-11f1-8d7c-22ccbcc910ea-0

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants