Skip to content

Revert MetricStorage configuration from lightspeed-operator - #122

Closed
omkarjoshi0304 wants to merge 1 commit into
openstack-k8s-operators:mainfrom
omkarjoshi0304:revert-metricstorage-config
Closed

omkarjoshi0304 wants to merge 1 commit into
openstack-k8s-operators:mainfrom
omkarjoshi0304:revert-metricstorage-config

Conversation

@omkarjoshi0304

@omkarjoshi0304 omkarjoshi0304 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reverts commit 57acabc which added MetricStorage detection and Prometheus configuration to lightspeed-operator.

Reason for Revert

The MetricStorage configuration approach violated namespace isolation principles by having lightspeed-operator watch resources in the openstack namespace via dynamic watches.

Alternative Solution

The metric list functionality will be implemented in openstack-operator instead (see openstack-k8s-operators/openstack-operator#2165), where rhoso-mcps is deployed. This aligns better with the architecture and respects namespace boundaries.

What This Reverts

  • Dynamic MetricStorage watch from cmd/main.go
  • RBAC permissions for metricstorages resource
  • Prometheus configuration logic in mcp_server.go
  • KUTTL test assets for MetricStorage detection
  • Test directory rename (application-credentials-and-metric-storage → application-credentials)
  • OpenTelemetry dependency bumps (will be re-added in a separate PR if needed)

Summary by CodeRabbit

  • Behavior Changes
    • MCP server configuration no longer includes Prometheus connection details, such as its host, port, or CA certificate settings.
    • The operator no longer discovers or watches MetricStorage resources, or requests access to them.
    • OpenStack readiness-dependent configuration and user-provided RHOS MCP settings remain supported.

@openshift-ci
openshift-ci Bot requested review from Akrog and lpiwowar October 6, 2026 15:50
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: openstack-k8s-operators/lightspeed-operator/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: fb092baa-bc67-4614-aab1-bd2d98df2be2

📥 Commits

Reviewing files that changed from the base of the PR and between 523be1a and e3a451b.


⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum

📒 Files selected for processing (41)
  • .govulncheck-ignore.yaml
  • cmd/main.go
  • config/rbac/role.yaml
  • go.mod
  • internal/controller/assets/mcp_server_config.yaml.tmpl
  • internal/controller/common_test.go
  • internal/controller/constants.go
  • internal/controller/mcp_server.go
  • internal/controller/mcp_server_test.go
  • internal/controller/openstacklightspeed_controller.go
  • test/kuttl/common/mock-openstack/metricstorage-crd.yaml
  • test/kuttl/common/mock-openstack/mock-metricstorage-resource.yaml
  • test/kuttl/common/shared_funcs.sh
  • test/kuttl/tests/application-credentials-and-metric-storage/02-assert-openstack-crds.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/02-create-metricstorage-crd.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/03-create-mock-metricstorage-resource.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/04-assert-mock-openstack.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/13-cleanup-mock-openstack.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/14-errors-mock-openstack.yaml
  • test/kuttl/tests/application-credentials/00-mock-resources.yaml
  • test/kuttl/tests/application-credentials/01-assert-mock-objects-created.yaml
  • test/kuttl/tests/application-credentials/02-assert-openstack-crds.yaml
  • test/kuttl/tests/application-credentials/02-create-kac-crd.yaml
  • test/kuttl/tests/application-credentials/02-create-oscp-crd.yaml
  • test/kuttl/tests/application-credentials/03-create-mock-keystone.yaml
  • test/kuttl/tests/application-credentials/03-create-mock-oscp-resources.yaml
  • test/kuttl/tests/application-credentials/04-assert-mock-openstack.yaml
  • test/kuttl/tests/application-credentials/05-create-openstack-lightspeed-instance.yaml
  • test/kuttl/tests/application-credentials/06-assert-ac-resources.yaml
  • test/kuttl/tests/application-credentials/07-assert-intermediate-state.yaml
  • test/kuttl/tests/application-credentials/07-errors-intermediate-state.yaml
  • test/kuttl/tests/application-credentials/08-simulate-keystone-operator.yaml
  • test/kuttl/tests/application-credentials/09-assert-mcp-credentials.yaml
  • test/kuttl/tests/application-credentials/10-cleanup-openstack-lightspeed-instance.yaml
  • test/kuttl/tests/application-credentials/11-assert-ac-cleanup.yaml
  • test/kuttl/tests/application-credentials/11-errors-ac-cleanup.yaml
  • test/kuttl/tests/application-credentials/12-errors-openstack-lightspeed-instance.yaml
  • test/kuttl/tests/application-credentials/13-cleanup-mock-openstack.yaml
  • test/kuttl/tests/application-credentials/14-errors-mock-openstack.yaml
  • test/kuttl/tests/application-credentials/15-cleanup-mock-objects.yaml
  • test/kuttl/tests/application-credentials/16-errors-mock-objects.yaml

💤 Files with no reviewable changes (33)
  • test/kuttl/tests/application-credentials/01-assert-mock-objects-created.yaml
  • test/kuttl/tests/application-credentials/06-assert-ac-resources.yaml
  • test/kuttl/tests/application-credentials/02-create-kac-crd.yaml
  • test/kuttl/tests/application-credentials/12-errors-openstack-lightspeed-instance.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/02-assert-openstack-crds.yaml
  • internal/controller/constants.go
  • internal/controller/openstacklightspeed_controller.go
  • test/kuttl/tests/application-credentials/07-assert-intermediate-state.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/14-errors-mock-openstack.yaml
  • test/kuttl/tests/application-credentials/09-assert-mcp-credentials.yaml
  • .govulncheck-ignore.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/13-cleanup-mock-openstack.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/02-create-metricstorage-crd.yaml
  • test/kuttl/tests/application-credentials/11-errors-ac-cleanup.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/03-create-mock-metricstorage-resource.yaml
  • test/kuttl/tests/application-credentials/11-assert-ac-cleanup.yaml
  • test/kuttl/common/mock-openstack/metricstorage-crd.yaml
  • test/kuttl/tests/application-credentials/05-create-openstack-lightspeed-instance.yaml
  • test/kuttl/tests/application-credentials/03-create-mock-keystone.yaml
  • test/kuttl/tests/application-credentials/00-mock-resources.yaml
  • test/kuttl/tests/application-credentials/16-errors-mock-objects.yaml
  • test/kuttl/tests/application-credentials/15-cleanup-mock-objects.yaml
  • test/kuttl/tests/application-credentials/07-errors-intermediate-state.yaml
  • config/rbac/role.yaml
  • cmd/main.go
  • test/kuttl/tests/application-credentials/02-create-oscp-crd.yaml
  • test/kuttl/tests/application-credentials-and-metric-storage/04-assert-mock-openstack.yaml
  • test/kuttl/tests/application-credentials/08-simulate-keystone-operator.yaml
  • test/kuttl/common/shared_funcs.sh
  • internal/controller/assets/mcp_server_config.yaml.tmpl
  • test/kuttl/common/mock-openstack/mock-metricstorage-resource.yaml
  • test/kuttl/tests/application-credentials/10-cleanup-openstack-lightspeed-instance.yaml
  • test/kuttl/tests/application-credentials/03-create-mock-oscp-resources.yaml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.



📝 Walkthrough

Walkthrough

The operator no longer discovers MetricStorage resources or writes Prometheus connection settings into MCP configuration. The change also removes related Kubernetes permissions, dependencies, fixtures, and KUTTL assertions.

Changes

MetricStorage-based Prometheus configuration removal

Layer / File(s) Summary
Remove Prometheus discovery and MCP configuration
internal/controller/mcp_server.go, internal/controller/constants.go, internal/controller/assets/mcp_server_config.yaml.tmpl, internal/controller/*_test.go
The MCP configuration builder and reconciliation paths no longer use Prometheus connection details from MetricStorage. The template no longer emits the Prometheus section, and the related tests were removed or updated.
Remove MetricStorage integration wiring
cmd/main.go, config/rbac/role.yaml, internal/controller/openstacklightspeed_controller.go, go.mod, .govulncheck-ignore.yaml
The dynamic watch and RBAC rules no longer include MetricStorage. The telemetry API dependency and associated indirect dependencies and vulnerability ignore entry were removed. Other indirect dependency versions also changed.
Update application-credential KUTTL coverage
test/kuttl/common/*, test/kuttl/tests/application-credentials-and-metric-storage/*, test/kuttl/tests/application-credentials/*
The MetricStorage KUTTL scenario, fixtures, and Prometheus assertion were removed. Several application-credential manifests now link to shared OpenStack mock manifests.

Priority: ➖ Normal

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

Change: Bug fix


Merge Risk: ⚪ Minimal · up to e3a45

No actionable issue remains from the reviewed removal; the change is mergeable after normal checks.


Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Keep Documentation Current Error The pull request changes user-visible cluster-introspection behavior. The diff removes MetricStorage detection and the generated Prometheus configuration from mcp_server.go and `mcp_server_config.ya… Update docs/usage.md to describe the supported scope after this revert. State that rhoso_mcps no longer configures or supports MetricStorage/Prometheus metric-list access in lightspeed-operator, and identify the separate openstack-opera…
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: reverting MetricStorage configuration from lightspeed-operator.
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.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (5 skipped: 5 unsupported.)


Full details: Keep Documentation Current

Explanation

The pull request changes user-visible cluster-introspection behavior. The diff removes MetricStorage detection and the generated Prometheus configuration from mcp_server.go and mcp_server_config.yaml.tmpl, so metric-list operations no longer receive the RHOSO 18 endpoint. The PR also removes the MetricStorage watch and RBAC permissions. No README.md or docs/*.md file changes, and neither revision documents this limitation. docs/usage.md is the applicable usage documentation because it describes the rhoso_mcps feature and its read-only cluster-resource tools.

Resolution

Update docs/usage.md to describe the supported scope after this revert. State that rhoso_mcps no longer configures or supports MetricStorage/Prometheus metric-list access in lightspeed-operator, and identify the separate openstack-operator implementation as the provider when that is the supported deployment path. Update any linked configuration or troubleshooting text if needed.


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

dprince
dprince previously approved these changes Oct 6, 2026
Comment thread cmd/main.go Resolved
@centosinfra-prod-github-app

Copy link
Copy Markdown

@lpiwowar
lpiwowar self-requested a review October 9, 2026 08:30
…RHOSO 18"

This reverts commit 57acabc.

The MetricStorage configuration approach violated namespace isolation by
having lightspeed-operator watch resources in the openstack namespace.

The metric list fix will be implemented in openstack-operator instead
(PR #2165), where rhoso-mcps is deployed, using a simpler Get() approach
without dynamic watches.

Also bumps go.opentelemetry.io/otel/{sdk,exporters/otlp/otlptrace,
exporters/otlp/otlptrace/otlptracegrpc} to v1.45.0 to keep GO-2026-6505
fixed after go.mod/go.sum were reverted to pre-57acabc versions.

Related: OSPRH-36685
@openshift-ci

openshift-ci Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: omkarjoshi0304
Once this PR has been reviewed and has the lgtm label, please assign lpiwowar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: omkarjoshi0304
Once this PR has been reviewed and has the lgtm label, please assign lpiwowar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@centosinfra-prod-github-app

Copy link
Copy Markdown

@omkarjoshi0304

Copy link
Copy Markdown
Collaborator Author

closing this PR since the changes has been covered in this PR -> #127

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants