Skip to content

WIP: remove runtime extractor manifests for testing#1260

Draft
opokornyy wants to merge 4 commits into
openshift:masterfrom
opokornyy:remove-extractor-manifests
Draft

WIP: remove runtime extractor manifests for testing#1260
opokornyy wants to merge 4 commits into
openshift:masterfrom
opokornyy:remove-extractor-manifests

Conversation

@opokornyy
Copy link
Copy Markdown
Contributor

@opokornyy opokornyy commented Mar 30, 2026

For testing purposes, this change allows building a cluster in which the CVO is not responsible for runtime-extractor deployment.

This PR removes the runtime extractor manifests used by the CVO operator for deployment.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • None

Documentation

  • None

Unit Tests

  • None

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

  • None

Summary by CodeRabbit

  • Updates

    • Updated Go language version requirement to 1.25.0 and removed pinned toolchain directive.
  • Infrastructure Changes

    • Modified deployment configuration with additional environment variable references for related container images.
    • Removed insights-runtime-extractor DaemonSet resource from cluster manifests.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 30, 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

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

Go language version is upgraded from 1.24.6 to 1.25.0 with toolchain directive removed. A linter suppression is added to the gendoc tool. Kubernetes deployment manifest is restructured with three new environment variables injected. The insights-runtime-extractor DaemonSet manifest is deleted.

Changes

Cohort / File(s) Summary
Go Tooling Updates
cmd/gendoc/main.go, go.mod
Added staticcheck nolint suppression for deprecated API; upgraded Go version to 1.25.0 and removed toolchain pinning.
Kubernetes Manifests
manifests/06-deployment.yaml, manifests/10-insights-runtime-extractor.yaml
Deployment manifest restructured with three new environment variables referencing image references; insights-runtime-extractor DaemonSet manifest completely removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions the core change (removing runtime extractor manifests) but includes 'WIP' and 'for testing' which are scope/context qualifiers rather than describing what the change does itself.
Description check ✅ Passed The PR description follows the template structure with all required sections completed, including purpose, category, and confirmation that no breaking changes exist.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 modifies only non-test files (Go utility, module definition, Kubernetes manifests). No Ginkgo test definitions found.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code changes; only go.mod, cmd/gendoc/main.go, and manifests/*.yaml files are modified.
Microshift Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests; it only updates Go version, adds linter comment, removes DaemonSet manifest, and modifies deployment manifest.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests. Changes consist of Go version updates, linter suppressions, Kubernetes manifest modifications, and file removals. No Ginkgo test definitions (It(), Describe(), Context(), When(), etc.) are present, so Single Node OpenShift compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR does not introduce or modify scheduling constraints; only adds environment variables to Deployment and removes DaemonSet.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is not applicable to this pull request. The changes modify build-time documentation generation, module metadata, and Kubernetes manifests—none of which participate in OTE communication contracts.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The custom check for IPv6 and Disconnected Network Test Compatibility is not applicable to this PR as it only modifies Go module configuration, documentation tooling, and Kubernetes manifests without adding Ginkgo e2e tests.

✏️ 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
Copy link
Copy Markdown

openshift-ci Bot commented Mar 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: opokornyy

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 Mar 30, 2026
@opokornyy
Copy link
Copy Markdown
Contributor Author

/hold

For testing purposes, this change allows building a cluster in which the CVO is not responsible for runtime-extractor deployment.

@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 Mar 30, 2026
@opokornyy opokornyy changed the title feat: remove runtime extractor manifests for testing WIP: remove runtime extractor manifests for testing Mar 30, 2026
Update the golang version to 1.25 that is already
used in the Insights Operator Dockerfile.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
This function is used to generate documentation
and is deprecated since go 1.25, but still working.
It is not a crutial function for the Insights
Operator.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
This commit removes runtime extractor manifests
used by the CVO operator for deployment.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Add required environment variables that should be
populated by CVO operator with the images used to
deploy runtime-extractor.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@opokornyy opokornyy force-pushed the remove-extractor-manifests branch from 02540e1 to b31220e Compare April 28, 2026 12:16
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

🧹 Nitpick comments (3)
cmd/gendoc/main.go (1)

183-183: Good short-term suppression; track migration to golang.org/x/tools/go/packages.

The nolint is acceptable, but migrate to golang.org/x/tools/go/packages.Load with Mode: packages.NeedSyntax | packages.NeedCompiledGoFiles to replace the deprecated parser.ParseDir. This preserves comment and doc parsing while respecting build tags. Tie this to a follow-up issue to complete the migration before the API changes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/gendoc/main.go` at line 183, The code currently uses the deprecated
parser.ParseDir (seen at the call to parser.ParseDir) with a nolint; replace
this with golang.org/x/tools/go/packages.Load by creating a packages.Config and
calling packages.Load with Mode set to packages.NeedSyntax |
packages.NeedCompiledGoFiles so comments/doc nodes are preserved and build tags
are respected; update any downstream logic that iterates the returned packages'
Syntax/Files instead of the ast.Package map, ensure fset handling is preserved,
and add a follow-up issue to complete and validate the migration before the
parser API is removed.
go.mod (1)

3-3: Adding explicit toolchain go1.25.0 is optional but recommended for stricter reproducibility.

Setting go 1.25.0 alone provides reproducibility—it implicitly resolves to go1.25.0 toolchain by default in Go 1.25. However, adding an explicit toolchain go1.25.0 directive (or pinning a specific patch like go1.25.5) provides more precise control and ensures identical binaries across CI and local builds. Per Go's official toolchain documentation, explicit toolchain pinning is a best practice for reproducible builds, especially in CI environments.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go.mod` at line 3, Add an explicit toolchain directive to go.mod to pin the
Go toolchain version for stricter reproducibility: update the file containing
the existing "go 1.25.0" line by adding a "toolchain go1.25.0" directive (or a
patch-pinned variant like "toolchain go1.25.5") so CI and local builds use the
exact same Go toolchain; ensure the change sits alongside the existing go
directive in go.mod and commit the updated file.
manifests/06-deployment.yaml (1)

50-52: Use block-style emptyDir for the snapshots volume to keep the sizeLimit note actionable.

Line 51 (emptyDir: {}) and Line 52 (commented sizeLimit) are a bit brittle for future edits. Block form is easier to safely modify later.

♻️ Suggested cleanup
         - name: snapshots
-          emptyDir: {}
-            `#sizeLimit`: 1Gi # bug https://bugzilla.redhat.com/show_bug.cgi?id=1713207
+          emptyDir:
+            # sizeLimit: 1Gi # bug https://bugzilla.redhat.com/show_bug.cgi?id=1713207
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@manifests/06-deployment.yaml` around lines 50 - 52, The snapshots volume uses
inline emptyDir (`emptyDir: {}`) which makes the commented sizeLimit brittle;
change the volume named "snapshots" to use block-style emptyDir (i.e.,
`emptyDir:` on its own line) and move the commented `#sizeLimit: 1Gi` underneath
it with correct YAML indentation so the note remains actionable and safe to edit
later; update the volume definition where `snapshots` and `emptyDir` appear
(preserve the comment text and indentation).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@manifests/06-deployment.yaml`:
- Around line 105-110: The manifests include
RELATED_IMAGE_INSIGHTS_RUNTIME_EXTRACTOR,
RELATED_IMAGE_INSIGHTS_RUNTIME_EXPORTER, and RELATED_IMAGE_KUBE_RBAC_PROXY env
vars but no workload manifest or reconciliation uses them; either (A) add a
runtime-extractor workload manifest (Deployment or DaemonSet) that uses those
env vars as the image values and sets the expected pod labels referenced by
pkg/gatherers/workloads/gather_workloads_runtime_infos.go so the gatherer finds
running pods, or (B) implement controller reconciliation in the operator to
create/update the runtime-extractor workload using the env vars
(RELATED_IMAGE_INSIGHTS_RUNTIME_EXTRACTOR,
RELATED_IMAGE_INSIGHTS_RUNTIME_EXPORTER, RELATED_IMAGE_KUBE_RBAC_PROXY) and
ensure the created pods have the labels and owner refs the gatherer expects;
update tests and manifests accordingly so the gatherer no longer errors with “no
running pods found for the insights-runtime-extractor statefulset.”

---

Nitpick comments:
In `@cmd/gendoc/main.go`:
- Line 183: The code currently uses the deprecated parser.ParseDir (seen at the
call to parser.ParseDir) with a nolint; replace this with
golang.org/x/tools/go/packages.Load by creating a packages.Config and calling
packages.Load with Mode set to packages.NeedSyntax |
packages.NeedCompiledGoFiles so comments/doc nodes are preserved and build tags
are respected; update any downstream logic that iterates the returned packages'
Syntax/Files instead of the ast.Package map, ensure fset handling is preserved,
and add a follow-up issue to complete and validate the migration before the
parser API is removed.

In `@go.mod`:
- Line 3: Add an explicit toolchain directive to go.mod to pin the Go toolchain
version for stricter reproducibility: update the file containing the existing
"go 1.25.0" line by adding a "toolchain go1.25.0" directive (or a patch-pinned
variant like "toolchain go1.25.5") so CI and local builds use the exact same Go
toolchain; ensure the change sits alongside the existing go directive in go.mod
and commit the updated file.

In `@manifests/06-deployment.yaml`:
- Around line 50-52: The snapshots volume uses inline emptyDir (`emptyDir: {}`)
which makes the commented sizeLimit brittle; change the volume named "snapshots"
to use block-style emptyDir (i.e., `emptyDir:` on its own line) and move the
commented `#sizeLimit: 1Gi` underneath it with correct YAML indentation so the
note remains actionable and safe to edit later; update the volume definition
where `snapshots` and `emptyDir` appear (preserve the comment text and
indentation).
🪄 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: 68bf9f0a-ba56-4c64-8697-d80e6f23fd8f

📥 Commits

Reviewing files that changed from the base of the PR and between 50525ba and b31220e.

📒 Files selected for processing (4)
  • cmd/gendoc/main.go
  • go.mod
  • manifests/06-deployment.yaml
  • manifests/10-insights-runtime-extractor.yaml
💤 Files with no reviewable changes (1)
  • manifests/10-insights-runtime-extractor.yaml

Comment on lines +105 to +110
- name: RELATED_IMAGE_INSIGHTS_RUNTIME_EXTRACTOR
value: quay.io/openshift/origin-insights-runtime-extractor:latest
- name: RELATED_IMAGE_INSIGHTS_RUNTIME_EXPORTER
value: quay.io/openshift/origin-insights-runtime-exporter:latest
- name: RELATED_IMAGE_KUBE_RBAC_PROXY
value: quay.io/openshift/origin-kube-rbac-proxy:latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Confirm code reads the three env vars added in manifests/06-deployment.yaml
rg -n --type=go -C3 'Getenv\("RELATED_IMAGE_(INSIGHTS_RUNTIME_EXTRACTOR|INSIGHTS_RUNTIME_EXPORTER|KUBE_RBAC_PROXY)"\)'

# 2) Find where runtime-extractor/runtime-exporter/kube-rbac-proxy images are composed/applied
rg -n --type=go -C3 'insights-runtime-extractor|insights-runtime-exporter|kube-rbac-proxy|RELATED_IMAGE_'

# 3) Locate the reconciler/build path for Kubernetes objects that should now use those env vars
rg -n --type=go -C3 'DaemonSet|Deployment|Service|Create|Apply|Reconcile'

Repository: openshift/insights-operator

Length of output: 1797


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for usage of the three RELATED_IMAGE env vars
echo "=== Searching for env var reads ==="
rg -n --type=go 'RELATED_IMAGE_(INSIGHTS_RUNTIME_EXTRACTOR|INSIGHTS_RUNTIME_EXPORTER|KUBE_RBAC_PROXY)' -C 3

echo -e "\n=== Searching for Getenv usage ==="
rg -n --type=go 'Getenv.*RELATED_IMAGE' -C 3

echo -e "\n=== Searching for runtime-extractor image references ==="
rg -n --type=go 'insights-runtime-extractor.*image|runtime-extractor.*image' -C 3

echo -e "\n=== Searching for deployment reconciliation with runtime ==="
rg -n --type=go 'runtime.*Deployment|DaemonSet.*runtime' -C 3

Repository: openshift/insights-operator

Length of output: 107


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Searching for any RELATED_IMAGE in entire codebase ==="
rg -n 'RELATED_IMAGE' -C 3

echo -e "\n=== Checking manifests directory structure ==="
fd -t f '.*\.yaml' manifests/ | head -20

echo -e "\n=== Looking at manifests/06-deployment.yaml for full context ==="
cat manifests/06-deployment.yaml | head -150

echo -e "\n=== Searching for references to runtime-extractor deployment ==="
rg -n 'runtime.extractor|runtime-extractor' -i -C 3

echo -e "\n=== Searching for manifest application/reconciliation logic ==="
rg -n 'manifest|yaml|apply.*manifest' --type=go -i -C 2 | head -50

Repository: openshift/insights-operator

Length of output: 27643


The RELATED_IMAGE_ environment variables are not consumed by any code in the codebase.*

No reconciliation logic reads these three environment variables (RELATED_IMAGE_INSIGHTS_RUNTIME_EXTRACTOR, RELATED_IMAGE_INSIGHTS_RUNTIME_EXPORTER, RELATED_IMAGE_KUBE_RBAC_PROXY). Additionally, the deployment or DaemonSet manifest for the runtime-extractor workload itself is missing from the manifests directory.

While support manifests exist (ServiceAccount, ClusterRole, Service in manifests/03-*.yaml and manifests/10-*), there is no manifest or controller logic to actually deploy the runtime-extractor pods. The gathering code in pkg/gatherers/workloads/gather_workloads_runtime_infos.go expects these pods to exist and will fail with "no running pods found for the insights-runtime-extractor statefulset" if they are missing.

After removing manifests/10-insights-runtime-extractor.yaml, either:

  1. Add a deployment/DaemonSet manifest for runtime-extractor with proper pod labels and image references, or
  2. Implement reconciliation logic in the operator controller to create these workloads using the image values from the environment variables

Without one of these, runtime gathering will fail at deployment time.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@manifests/06-deployment.yaml` around lines 105 - 110, The manifests include
RELATED_IMAGE_INSIGHTS_RUNTIME_EXTRACTOR,
RELATED_IMAGE_INSIGHTS_RUNTIME_EXPORTER, and RELATED_IMAGE_KUBE_RBAC_PROXY env
vars but no workload manifest or reconciliation uses them; either (A) add a
runtime-extractor workload manifest (Deployment or DaemonSet) that uses those
env vars as the image values and sets the expected pod labels referenced by
pkg/gatherers/workloads/gather_workloads_runtime_infos.go so the gatherer finds
running pods, or (B) implement controller reconciliation in the operator to
create/update the runtime-extractor workload using the env vars
(RELATED_IMAGE_INSIGHTS_RUNTIME_EXTRACTOR,
RELATED_IMAGE_INSIGHTS_RUNTIME_EXPORTER, RELATED_IMAGE_KUBE_RBAC_PROXY) and
ensure the created pods have the labels and owner refs the gatherer expects;
update tests and manifests accordingly so the gatherer no longer errors with “no
running pods found for the insights-runtime-extractor statefulset.”

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant