Skip to content

Install NOO using OLMv0 instead of OLMv1 - #3115

Open
stleerh wants to merge 1 commit into
openshift:masterfrom
stleerh:day0-use-olmv0
Open

Install NOO using OLMv0 instead of OLMv1#3115
stleerh wants to merge 1 commit into
openshift:masterfrom
stleerh:day0-use-olmv0

Conversation

@stleerh

@stleerh stleerh commented Aug 11, 2026

Copy link
Copy Markdown
  • Install NOO using OLMv0 instead of OLMv1, since there's a lack of Console integration with OLMv1. This rolls back to the original design in the Enhancement Proposal.
  • Remove the code to create the namespace for FlowCollector, since it's created automatically
  • Fix CSV name for OLMv0
  • Add two new test cases for OLMv0
  • Add a NOO installation timeout so if it fails, it won't retry forever.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Operator installation now uses the stable release channel from the OpenShift Operator catalog.
    • Flow collection is configured automatically after the operator is installed.
  • Bug Fixes

    • Improved detection of the installed network observability operator.
    • Added handling for failed and in-progress installations.
    • Installations now time out after 20 minutes with an appropriate status.
    • Updated installation status messages to reflect the current process.
  • Tests

    • Expanded coverage for successful, failed, and in-progress installations.

Walkthrough

The NetObserv operator installation now uses an OLM v0 Subscription. Reconciliation detects the operator CSV, applies the FlowCollector manifest directly, and stops retrying after a 20-minute installation timeout.

Changes

NetObserv OLM installation

Layer / File(s) Summary
OLM installation resources
bindata/observability/07-observability-operator.yaml
The manifest replaces manual installer resources with an OperatorGroup and a stable-channel Subscription.
Installation reconciliation and timeout
pkg/controller/observability/observability_controller.go
The controller tracks OLM v0 installation status, matches network-observability-operator CSV names, applies the FlowCollector manifest directly, and records DeploymentTimedOut after 20 minutes.
OLM installation tests
pkg/controller/observability/observability_controller_test.go
Tests use explicit CSV names and phases. Tests cover failed and in-progress installations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ObservabilityController
  participant OpenShiftOLM
  participant NetObservOperator
  ObservabilityController->>OpenShiftOLM: Apply OLM v0 Subscription
  OpenShiftOLM->>NetObservOperator: Install stable-channel operator
  ObservabilityController->>OpenShiftOLM: Check CSV installation status
  OpenShiftOLM-->>ObservabilityController: Return CSV phase
  ObservabilityController->>NetObservOperator: Apply FlowCollector manifest
Loading

Suggested reviewers: oliviercazade


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (5 errors, 1 warning)

Check name Status Explanation Resolution
Pr Quality ❌ Error The PR changes OLM installation and reconciliation (416 non-vendor lines), but its description has no Testing section with CI lanes/platforms and no upgrade or rollback guidance. Add Why, What, and Testing sections with automated CNO jobs and platforms. Document user impact and upgrade/rollback behavior, and add an issue link if this is a bug fix.
Commit Message Quality ❌ Error The PR has three commits: two have empty bodies, and the first body only states an additional change without explaining why it is needed. Rewrite or squash the commits with concise, component-scoped subjects and bodies that state the OLMv0 and timeout rationale.
E2e Tests For Feature Changes ❌ Error The PR changes user-facing NOO installation behavior and adds a timeout, but its diff has no test/e2e files and the description has no Testing or How to verify section. Add relevant files under test/e2e and document CI jobs, covered platforms, and test results under a Testing or How to verify it section. If E2E is infeasible, document why there.
Docs For Feature And Behavior Changes ❌ Error The PR changes CNO NetworkObservability installation from OLMv1 ClusterExtension to OLMv0 Subscription and adds timeout/status behavior; no files under docs/ changed. Add documentation under docs/ for the OLMv0 installation flow, platform requirements, timeout status, and troubleshooting. If docs are not required, record the reason and use the specified override.
No-Sensitive-Data-In-Logs ❌ Error The corrected CSV prefix activates a path that copies arbitrary CSV status.message into an error and logs it with klog.Warningf; diagnostics may contain internal hostnames or sensitive data. Do not log raw CSV status.message. Log a fixed failure reason, or redact and length-limit diagnostic text before logging or storing it.
Test Structure And Quality ⚠️ Warning The PR adds two tests with seven new bare g.Expect assertions and no diagnostic messages, which violates the explicit assertion-message requirement. Add a meaningful failure message to each new g.Expect assertion, including the expected CSV phase, error, and installation flags.
✅ Passed checks (18 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Unit Tests For Go Changes ✅ Passed The PR diff changes bindata/observability YAML and production Go code, and also modifies pkg/controller/observability/observability_controller_test.go.
Rbac Least Privilege ✅ Passed The PR removes the installer ClusterRole and Role rules; it adds no ClusterRole or Role rules in bindata/ or manifests/, so no new wildcard or mutation access is introduced.
Stale Project Docs And Config ✅ Passed The PR changes only observability manifests, controller code, and tests. In-scope docs and .coderabbit.yaml are unchanged and contain no removed OLM, namespace, CSV, or manifest references.
Go And Test Code Quality ✅ Passed The PR adds only klog logging and an explicit 20*time.Minute duration; added tests have no time.Sleep, os.Setenv, or bare t.Fatal calls, and no new bare returns or unsafe map access.
Ai-Generated Code Smell ✅ Passed The diff adds focused timeout/OLMv0 logic and two proportional tests; comments explain behavior, with no AI-tool references, unrelated test bulk, or clear copy-paste/verbosity smell.
Stable And Deterministic Test Names ✅ Passed Changed tests use static Go Test function names; no Ginkgo It, Describe, Context, or When declarations exist in the changed paths or repository.
Microshift Test Compatibility ✅ Passed The diff adds only standard Go Test* unit tests; it adds no Ginkgo It, Describe, Context, or When e2e tests, so the MicroShift API check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds only Go unit tests in observability_controller_test.go; no Ginkgo e2e declarations or multi-node/HA assumptions were introduced.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds only Namespace, OperatorGroup, and Subscription fields; changed controller code adds timeout/OLMv0 logic. No topology-sensitive scheduling constraints were introduced.
Ote Binary Stdout Contract ✅ Passed The PR changes only observability reconciliation and unit-test fixtures; added klog calls are outside main/init/suite setup, and no OTE or Ginkgo process-level stdout writes were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The aggregate PR diff adds only two standard Go Test functions with fake clients; it adds no Ginkgo It/Describe tests, IPv4 assumptions, or external connectivity.
No-Weak-Crypto ✅ Passed PR diff adds only OLM manifests and reconciliation/tests; targeted scans found no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The aggregate PR diff adds only Namespace, OperatorGroup, and Subscription resources plus controller logic; it adds no privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
Title check ✅ Passed The title uses the imperative mood, stays under 72 characters, and accurately summarizes the OLMv0 installation change.
Description check ✅ Passed The description accurately covers the OLM migration, namespace change, CSV fix, timeout, and added tests.
✨ 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.

@openshift-ci
openshift-ci Bot requested a review from mattedallo August 11, 2026 02:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/controller/observability/observability_controller.go (1)

118-145: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Add e2e coverage and a PR Testing section for the OLMv0 migration.

This change alters user-facing installation behavior: the operator now installs through an OLMv0 Subscription, and the FlowCollector namespace is no longer created by CNO. The unit test file only received a comment rename, and the PR description has no Testing or How to verify it section.

Add or update tests under test/e2e/ for the OLMv0 install path, and describe the CI lanes, platform coverage, and results in the PR description.

As per coding guidelines: "For new or modified Go code under pkg/ that changes user-facing behavior or fixes a bug, add or modify corresponding files under test/e2e/, and include a PR Testing or How to verify it section describing CI lanes, platform coverage, and test results."

🤖 Prompt for 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.

In `@pkg/controller/observability/observability_controller.go` around lines 118 -
145, Add or update end-to-end coverage under test/e2e for the OLMv0 installation
path, including validation that the FlowCollector namespace is handled correctly
without CNO creating it. Update the PR description with a Testing or How to
verify it section documenting CI lanes, platform coverage, and test results.

Source: Coding guidelines

🧹 Nitpick comments (1)
pkg/controller/observability/observability_controller.go (1)

128-130: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

The ceExists branch is now unreachable for OLMv0 installs.

ceExists is set from checkOLMv1Installation. With the OLMv0 Subscription this stays false, so the in-progress path at Line 129 never runs, and installNetObservOperator re-applies the Subscription on every requeue. The apply is idempotent, so the behavior is correct, but the "Applied OLM v0 Subscription" message at Line 124 repeats on each cycle and the comment at Line 128 describes a path that OLMv0 does not use.

Consider gating the apply on Subscription existence and reserving the in-progress log for the actual OLMv0 progressing state.

🤖 Prompt for 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.

In `@pkg/controller/observability/observability_controller.go` around lines 128 -
130, Update the installation flow around installNetObservOperator and ceExists
so OLMv0 applies the Subscription only when it does not already exist, avoiding
repeated apply logs on requeues. Reserve the “installation in progress” branch
and its comment for the actual OLMv1 ClusterExtension state, while preserving
requeue behavior for both installation paths.
🤖 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 `@bindata/observability/07-observability-operator.yaml`:
- Around line 6-22: Add NetworkPolicy resources for the netobserv-operator
namespace alongside the existing OperatorGroup and Subscription, following the
established operator-namespace pattern to explicitly isolate both ingress and
egress traffic. Ensure the policies target the netobserv-operator namespace and
preserve the current OLM resource configuration.
- Around line 12-22: Update the netobserv-operator Subscription handling to
avoid indefinitely retrying when the configured CatalogSource cannot be
resolved. Add bounded unresolved-attempt tracking and surface a degraded or
informative condition explaining that source/sourceNamespace may be unavailable,
while preserving normal installation when the catalog resolves.

In `@pkg/controller/observability/observability_controller.go`:
- Around line 116-134: Update checkOLMv0Installation and
isNetObservOperatorInstalled so a present FlowCollector CRD with an OLMv0 CSV
still installing is reported as installation in progress, not an identification
error. Propagate that progressing state through Reconcile, preserving the
existing requeue path and avoiding the DeploymentFailed condition until
installation actually fails.
- Around line 447-448: Update the OLMv0 CSV detection condition in
isNetObservOperatorInstalled to use the netobserv-operator prefix, matching
names such as netobserv-operator.v1.11.4-community, and correct the
observability spelling in the adjacent comment.

---

Outside diff comments:
In `@pkg/controller/observability/observability_controller.go`:
- Around line 118-145: Add or update end-to-end coverage under test/e2e for the
OLMv0 installation path, including validation that the FlowCollector namespace
is handled correctly without CNO creating it. Update the PR description with a
Testing or How to verify it section documenting CI lanes, platform coverage, and
test results.

---

Nitpick comments:
In `@pkg/controller/observability/observability_controller.go`:
- Around line 128-130: Update the installation flow around
installNetObservOperator and ceExists so OLMv0 applies the Subscription only
when it does not already exist, avoiding repeated apply logs on requeues.
Reserve the “installation in progress” branch and its comment for the actual
OLMv1 ClusterExtension state, while preserving requeue behavior for both
installation paths.
🪄 Autofix

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: Pro Plus

Run ID: ea7101a0-3ff1-44cc-a9db-567ca707b0d8

📥 Commits

Reviewing files that changed from the base of the PR and between a0ebeb0 and bd2d85d.

📒 Files selected for processing (3)
  • bindata/observability/07-observability-operator.yaml
  • pkg/controller/observability/observability_controller.go
  • pkg/controller/observability/observability_controller_test.go

Comment thread bindata/observability/07-observability-operator.yaml
Comment on lines +12 to +22
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: netobserv-operator
spec:
namespace: netobserv-operator
serviceAccount:
name: netobserv-operator-installer
source:
sourceType: Catalog
catalog:
packageName: netobserv-operator
channels: [stable]
spec:
channel: stable
installPlanApproval: Automatic
name: netobserv-operator
source: redhat-operators
sourceNamespace: openshift-marketplace

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Hardcoded catalog source can break disconnected and custom-catalog clusters.

source: redhat-operators and sourceNamespace: openshift-marketplace assume the default Red Hat catalog is present and enabled. Clusters that disable the default sources or mirror catalogs under a different CatalogSource name will never resolve this Subscription. The reconcile loop then requeues indefinitely without a terminal condition.

Consider surfacing a degraded or informative condition after a bounded number of unresolved attempts, so the cluster admin sees why NetObserv never installs.

🤖 Prompt for 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.

In `@bindata/observability/07-observability-operator.yaml` around lines 12 - 22,
Update the netobserv-operator Subscription handling to avoid indefinitely
retrying when the configured CatalogSource cannot be resolved. Add bounded
unresolved-attempt tracking and surface a degraded or informative condition
explaining that source/sourceNamespace may be unavailable, while preserving
normal installation when the catalog resolves.

Comment thread pkg/controller/observability/observability_controller.go
Comment thread pkg/controller/observability/observability_controller.go Outdated
@arkadeepsen

Copy link
Copy Markdown
Member

/payload-job-with-prs periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview openshift/origin#31342

/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3

@stleerh I am trigerring these payload tests. We need to ensure these are working fine with the e2e tests being added for netobserv operator as well as it is not breaking the existing payload jobs.

In the meanwile, can you please fix the unit test?

cc @danwinship

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@arkadeepsen: An error was encountered. No known errors were detected, please see the full error message for details.

Full error message. unable to get additional pr info from string: /payload-job: string: /payload-job doesn't match expected format: org/repo#number

Please contact an administrator to resolve this issue.

@arkadeepsen

Copy link
Copy Markdown
Member

/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ddb1ba30-9584-11f1-9efc-efe47012d50e-0

@arkadeepsen

Copy link
Copy Markdown
Member

/payload-job-with-prs periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview openshift/origin#31342

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/e6312c40-9584-11f1-94bc-26cf251f4a4b-0

@danwinship

Copy link
Copy Markdown
Contributor

/approve
but I'll leave for someone who understands it better to /lgtm.
also, please squash the fix(es) in with the main commit

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/controller/observability/observability_controller.go (1)

107-154: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Add payload E2E coverage for the OLMv0 installation path.

This change modifies installation timeout, Subscription progression, and FlowCollector application behavior. Add test/e2e/ coverage for the tech-preview payload lanes, including serial variants, and document CI lanes, platform coverage, and results in the PR testing section.

As per coding guidelines, pkg/**/*.go changes that alter user-facing behavior require corresponding test/e2e/ changes and PR testing details.

🤖 Prompt for 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.

In `@pkg/controller/observability/observability_controller.go` around lines 107 -
154, Add test/e2e coverage for the tech-preview payload lanes covering OLMv0
installation, including serial variants and the changed installation-timeout,
Subscription progression, and FlowCollector application behavior. Document the
CI lanes, platform coverage, and test results in the PR testing section,
aligning with the modified reconciliation flow around
isNetObservOperatorInstalled and applyManifest.

Source: Coding guidelines

🤖 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 `@pkg/controller/observability/observability_controller_test.go`:
- Around line 765-766: Update createTestCSV and the fixture setup around the
status fields to handle every SetNestedField error, including both calls setting
status.reason and status.message and the call at line 153. Propagate or fail the
test on errors instead of discarding them, while preserving the existing fixture
values.

In `@pkg/controller/observability/observability_controller.go`:
- Line 110: Update all calls to setNetworkObservabilityCondition in the
reconciliation flow, including the DeploymentTimedOut path and the branches at
the other referenced locations, so their returned errors are handled rather than
assigned to _. Return a contextual error or requeue when a condition update
fails, ensuring reconciliation does not continue or silently succeed until the
condition is persisted.
- Around line 205-219: Change ReconcileObservability.hasInstallTimedOut to
return (bool, error), propagate the Network CR client.Get error instead of
treating it as not timed out, and update Reconcile to handle the returned error
and retry the status check. Preserve the existing timeout evaluation for
successful reads and ensure all callers handle both return values.

---

Outside diff comments:
In `@pkg/controller/observability/observability_controller.go`:
- Around line 107-154: Add test/e2e coverage for the tech-preview payload lanes
covering OLMv0 installation, including serial variants and the changed
installation-timeout, Subscription progression, and FlowCollector application
behavior. Document the CI lanes, platform coverage, and test results in the PR
testing section, aligning with the modified reconciliation flow around
isNetObservOperatorInstalled and applyManifest.
🪄 Autofix

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: Pro Plus

Run ID: 62f35059-cebc-4549-9ab1-be21a95be6aa

📥 Commits

Reviewing files that changed from the base of the PR and between bd2d85d and 6cb4cda.

📒 Files selected for processing (2)
  • pkg/controller/observability/observability_controller.go
  • pkg/controller/observability/observability_controller_test.go

Comment on lines +765 to +766
_ = unstructured.SetNestedField(csv.Object, "InstallCheckFailed", "status", "reason")
_ = unstructured.SetNestedField(csv.Object, "install timeout", "status", "message")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 2 'func SetNestedField' -g '*.go' .
rg -n -C 2 'SetNestedField\(csv\.Object' pkg/controller/observability/observability_controller_test.go

Repository: openshift/cluster-network-operator

Length of output: 1492


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '235,285p' vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go
sed -n '120,165p' pkg/controller/observability/observability_controller_test.go
sed -n '735,780p' pkg/controller/observability/observability_controller_test.go
rg -n '_ = unstructured\.SetNestedField|SetNestedField\(' pkg/controller/observability/observability_controller_test.go

Repository: openshift/cluster-network-operator

Length of output: 5341


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 2 'createTestCSV\(' pkg/controller/observability/observability_controller_test.go
rg -n -C 3 'require\.(NoError|Error)|assert\.(NoError|Error)|t\.Helper\(\)|func createTestCSV' pkg/controller/observability/observability_controller_test.go | head -160

python3 - <<'PY'
def set_nested_field(obj, value, *fields):
    m = obj
    for field in fields[:-1]:
        if field in m:
            if isinstance(m[field], dict):
                m = m[field]
            else:
                return f"{field} is not a map"
        else:
            m[field] = {}
            m = m[field]
    m[fields[-1]] = value
    return None

csv = {"status": {}}
for value, field in [("InstallCheckFailed", "reason"), ("install timeout", "message")]:
    print(f"status.{field}: {set_nested_field(csv, value, 'status', field)}")
print(csv)
PY

Repository: openshift/cluster-network-operator

Length of output: 1993


Handle all SetNestedField errors in the test fixtures.

createTestCSV creates status as a map, so these calls currently cannot fail. Handle the ignored errors at lines 153, 765, and 766 to keep future fixture changes from producing misleading assertions.

🤖 Prompt for 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.

In `@pkg/controller/observability/observability_controller_test.go` around lines
765 - 766, Update createTestCSV and the fixture setup around the status fields
to handle every SetNestedField error, including both calls setting status.reason
and status.message and the call at line 153. Propagate or fail the test on
errors instead of discarding them, while preserving the existing fixture values.

Source: Path instructions

// Check if installation has been failing for too long
if r.hasInstallTimedOut(ctx) {
klog.Warning("Network Observability installation timed out, giving up")
_ = r.setNetworkObservabilityCondition(ctx, operatorv1.ConditionFalse, "DeploymentTimedOut",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Propagate condition-update errors.

Lines 110, 132, and 138 discard errors from setNetworkObservabilityCondition. If the update at Line 110 fails, reconciliation stops without persisting DeploymentTimedOut. Return a contextual error or requeue until the condition update succeeds.

As per path instructions, **/*.go must “Never ignore error returns.”

Also applies to: 132-132, 138-138

🤖 Prompt for 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.

In `@pkg/controller/observability/observability_controller.go` at line 110, Update
all calls to setNetworkObservabilityCondition in the reconciliation flow,
including the DeploymentTimedOut path and the branches at the other referenced
locations, so their returned errors are handled rather than assigned to _.
Return a contextual error or requeue when a condition update fails, ensuring
reconciliation does not continue or silently succeed until the condition is
persisted.

Source: Path instructions

Comment on lines +205 to +219
func (r *ReconcileObservability) hasInstallTimedOut(ctx context.Context) bool {
network := &operatorv1.Network{}
if err := r.client.Get(ctx, types.NamespacedName{Name: NetworkCRName}, network); err != nil {
return false
}

condition := operatorv1helpers.FindOperatorCondition(network.Status.Conditions, NetworkObservabilityDeployed)
if condition == nil || condition.Status != operatorv1.ConditionFalse {
return false
}
if condition.Reason == "DeploymentTimedOut" {
return true
}

return time.Since(condition.LastTransitionTime.Time) > installTimeout

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Return the Network CR read error.

Lines 207-209 treat a failed Get as “not timed out.” Change hasInstallTimedOut to return an error and let Reconcile retry the status check. This prevents an API failure from bypassing timeout-state evaluation.

As per path instructions, **/*.go must “Never ignore error returns.”

🤖 Prompt for 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.

In `@pkg/controller/observability/observability_controller.go` around lines 205 -
219, Change ReconcileObservability.hasInstallTimedOut to return (bool, error),
propagate the Network CR client.Get error instead of treating it as not timed
out, and update Reconcile to handle the returned error and retry the status
check. Preserve the existing timeout evaluation for successful reads and ensure
all callers handle both return values.

Source: Path instructions

@stleerh

stleerh commented Aug 12, 2026

Copy link
Copy Markdown
Author

@danwinship:

also, please squash the fix(es) in with the main commit

When merging, can't it just do a "Squash and merge" so it's automatic?

@arkadeepsen

Copy link
Copy Markdown
Member

/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
/payload-job periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-1of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-2of3
  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview-serial-3of3

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/417a8b00-960c-11f1-9470-fdf97521680d-0

@arkadeepsen

Copy link
Copy Markdown
Member

/payload-job-with-prs periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview openshift/origin#31342

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-ci-5.0-e2e-aws-ovn-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/4ac5b180-960c-11f1-82db-52870a3dfce1-0

@arkadeepsen

Copy link
Copy Markdown
Member

/test ?

@arkadeepsen

Copy link
Copy Markdown
Member

/testwith openshift/cluster-network-operator/master/e2e-gcp-ovn-techpreview openshift/origin#31342

Comment on lines 358 to 369
olmv1Installed, olmv1CEExists, olmv1Err := r.checkOLMv1Installation(ctx)
if olmv1Err != nil {
// Installation error from OLMv1
return false, olmv1CEExists, fmt.Errorf("OLMv1 installation error: %w", olmv1Err)
}

// Check OLMv0 (ClusterServiceVersion/Subscription) installation status
olmv0Installed, olmv0Err := r.checkOLMv0Installation(ctx)
if olmv0Err != nil && !errors.IsNotFound(olmv0Err) {
// Installation error from OLMv0
return false, olmv1CEExists, fmt.Errorf("OLMv0 installation error: %w", olmv0Err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@stleerh didn't you say you wanted to remove those checks, to only rely on CRD?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There was a long discussion regarding this in the previous PR and this was the approach finalized: #2925 (comment)

@stleerh stleerh Aug 13, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I want to make this change and now that I've done the investigation, I would like to move forward on this. The idea is that if the FlowCollector CRD exists, there must have been an attempt to install Network Observability. Therefore, it should not try to enable it anymore. In general, it should not try to repair or complete a partial install. This keeps it simple, and it's easy to understand and explain. It basically boils down to:

  • If FlowCollector CRD exists, exit.
  • Otherwise, install NOO.
  • If FlowCollector CR doesn't exist, create it.

Of course, it has to meet all of the prerequisites first. This is the current state. They are:

  • If feature gate is disabled, exit.
  • If set to NoAction, exit.
  • If NOO was already deployed before, exit.
  • If SNO and not set to InstallAndEnable, exit.
  • If timed out, exit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, if the CRD is not present will it be assumed that NOO is not installed? If that's the assumption, I think the github comment thread from that I shared above needs another look. There are various scenarios in which the CRD may not be there, and attempting to install NOO may fail. Probably the checks can be simplified as mentioned by you, but the whole thing can only rely on the presence of CRD alone.

Another thing to keep in mind is that the behavior should not deviate from the what has been documented in the API, since the user will expect the documented behavior.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Let's take the discussion separate from this PR. We must go back to OLMv0 because of the lack of Console support for OLMv1. This works as it stands right now. I'll go ahead and squash the commits.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Squash done

@jotak

jotak commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

LGTM
Incidentally, I very much prefer the approach here to have all rbac taken from the bundle (OLM v0) rather than having them defined in several places (here and in the netobserv repo). Those rbac can change between netobserv versions and it can be a pain to maintain across several repos. But the problem will reappear when switching to OLM v1 I guess

@danwinship

Copy link
Copy Markdown
Contributor

also, please squash the fix(es) in with the main commit

When merging, can't it just do a "Squash and merge" so it's automatic?

tide/merge-method-squash is not really very useful, because it assumes you want all of the commits squashed together, which you don't always (there may be multiple logically-independent commits in the PR, in addition to the fixup commits). Also, it squashes all of the commit messages together, which does not usually result in a commit message which is helpful for future readers.

- Install NOO using OLMv0 instead of OLMv1, since there's a lack of Console integration with OLMv1.
- Remove the code to create the namespace for FlowCollector, since it's created automatically
- Fix CSV name for OLMv0
- Add two new test cases for OLMv0
- Add a NOO installation tiemout so if it fails, it won't retry forever.
@arkadeepsen

Copy link
Copy Markdown
Member

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-ovn-upgrade-ipsec

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn-fdp-qe
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade
/test e2e-aws-ovn-windows
/test e2e-azure-ovn-upgrade
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-dualstack-bgp
/test e2e-metal-ipi-ovn-dualstack-bgp-local-gw
/test e2e-metal-ipi-ovn-ipv6
/test e2e-metal-ipi-ovn-ipv6-ipsec
/test e2e-ovn-ipsec-step-registry
/test hypershift-e2e-aks

@stleerh

stleerh commented Aug 17, 2026

Copy link
Copy Markdown
Author

/retest

@stleerh

stleerh commented Aug 18, 2026

Copy link
Copy Markdown
Author

It is failing on two unrelated tests. If there are no more open issues, can we get this merged?

@stleerh

stleerh commented Aug 19, 2026

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@stleerh: 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/e2e-aws-ovn-hypershift-conformance 5cef6d7 link true /test e2e-aws-ovn-hypershift-conformance
ci/prow/e2e-metal-ipi-ovn-dualstack-bgp-local-gw 5cef6d7 link true /test e2e-metal-ipi-ovn-dualstack-bgp-local-gw
ci/prow/5.1-upgrade-from-stable-5.0-e2e-aws-ovn-upgrade 5cef6d7 link false /test 5.1-upgrade-from-stable-5.0-e2e-aws-ovn-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.

@arkadeepsen

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2026
@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arkadeepsen, danwinship, stleerh

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-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants