Skip to content

OLS-1894 Add ROSA-aware OKP retrieval spec#1790

Open
blublinsky wants to merge 1 commit into
openshift:mainfrom
blublinsky:ols-1894-rosa-aware-spec
Open

OLS-1894 Add ROSA-aware OKP retrieval spec#1790
blublinsky wants to merge 1 commit into
openshift:mainfrom
blublinsky:ols-1894-rosa-aware-spec

Conversation

@blublinsky

@blublinsky blublinsky commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add spec documentation for ROSA cluster detection and ROSA-specific OKP product filtering
  • Operator detects ROSA via Console brand field + Infrastructure controlPlaneTopology
  • Passes product identifier as OLS_ROSA_PRODUCT env var to the service
  • No CRD changes — auto-detect only

Files changed

  • .ai/spec/what/app-server.md — New rule 15b for ROSA detection
  • .ai/spec/how/deployment-generation.mdOLS_ROSA_PRODUCT env var in deployment flow
  • .ai/spec/how/config-generation.md — ROSA product in integration points table

Related

  • Epic: OLS-1679
  • Story: OLS-1894
  • Design: docs/superpowers/specs/2026-07-06-rosa-aware-answering.md (ols workspace)
  • Companion service PR: pending

Test plan

  • Spec review only — no code changes

Made with Cursor

Summary by CodeRabbit

  • Documentation
    • Added guidance for deployment and app-server behavior covering new environment settings used during cluster setup.
    • Documented how cluster version and ROSA-related values are handled, including when they are present or omitted.
    • Clarified the conditions under which ROSA-specific configuration applies and the access needed for detection.

Add spec documentation for ROSA cluster detection and ROSA-specific
OKP product filtering. The operator detects ROSA via Console brand
and Infrastructure controlPlaneTopology, passing the product
identifier as OLS_ROSA_PRODUCT env var to the service.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci openshift-ci Bot requested review from bparees and xrajesh July 6, 2026 10:58
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Documentation-only changes to three spec files describing planned (OLS-1894) app-server environment variables: OCP_CLUSTER_VERSION and OLS_ROSA_PRODUCT. Updates cover behavior rules, deployment construction logic, and config generation integration points, with no code changes.

Changes

ROSA/Cluster Version Documentation

Layer / File(s) Summary
App-server behavior rules
.ai/spec/what/app-server.md
Documents rule 15a for OCP_CLUSTER_VERSION sourced from cluster-version lookup, and a new "ROSA-Aware OKP Retrieval" rule set describing ROSA/HCP-vs-Classic detection and OLS_ROSA_PRODUCT values, plus the needed RBAC permission.
Deployment construction spec
.ai/spec/how/deployment-generation.md
Documents conditional addition of OCP_CLUSTER_VERSION and OLS_ROSA_PRODUCT during AppServer deployment construction based on byokRAGOnly and cluster brand/topology.
Config generation integration point
.ai/spec/how/config-generation.md
Adds a table row noting OLS_ROSA_PRODUCT as an input source not reflected in generated config YAML.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding ROSA-aware OKP retrieval specification documentation.
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.
✨ 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.

@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: 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 @.ai/spec/what/app-server.md:
- Around line 26-32: Add the missing RBAC permission for the ROSA variant
lookup: the lookup role currently covers `clusterversions` and secret access,
but `Infrastructure/cluster` requires `get` on
`config.openshift.io/infrastructures`. Update the role used by the app-server
lookup path so the `controlPlaneTopology` read in the ROSA detection flow is
allowed, and mirror the same permission in the generated manifest/CSV. Ensure
the change stays aligned with the `OLS_ROSA_PRODUCT` detection logic that
depends on this lookup.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 81584dbc-a243-44cb-a026-5c91e3ab2a9d

📥 Commits

Reviewing files that changed from the base of the PR and between a1bbf9c and ef7e222.

📒 Files selected for processing (3)
  • .ai/spec/how/config-generation.md
  • .ai/spec/how/deployment-generation.md
  • .ai/spec/what/app-server.md

Comment on lines +26 to +32
### ROSA-Aware OKP Retrieval [PLANNED: OLS-1894]
15b. Unless `byokRAGOnly` is true, the operator detects whether the cluster is ROSA and, if so, which variant (Classic vs HCP). Detection uses two standard OpenShift API resources, following the same pattern as OCP version detection — determined once and passed to the service as an environment variable:
- **ROSA detection:** Read `console.operator.openshift.io/v1` Console `cluster` resource, field `.spec.customization.brand`. Value `ROSA` indicates a ROSA cluster (reliable on OCP 4.16+).
- **Variant detection:** Read `infrastructure.config.openshift.io/v1` Infrastructure `cluster` resource, field `.status.controlPlaneTopology`. `External` = HCP, `HighlyAvailable` = Classic.
- When ROSA is detected, the operator sets `OLS_ROSA_PRODUCT` on the app-server container: `red_hat_openshift_service_on_aws` for HCP, `red_hat_openshift_service_on_aws_classic_architecture` for Classic.
- On non-ROSA clusters the env var is absent and the service uses OCP-only retrieval.
- RBAC: requires `get` on `consoles` in the `operator.openshift.io` API group (Infrastructure is already covered by existing cluster-version permissions).

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 | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Repo files of interest:\n'
git ls-files '.ai/spec/what/app-server.md' | sed 's/^/ - /'
printf '\nSearch for infrastructure permission and ROSA-related references:\n'
rg -n --hidden --glob '!.git' -e 'infrastructure\.config\.openshift\.io' -e 'infrastructures/cluster' -e 'OLS_ROSA_PRODUCT' -e 'customization\.brand' -e 'controlPlaneTopology' .

Repository: openshift/lightspeed-operator

Length of output: 1519


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'RBAC and deployment files mentioning app-server / permissions:\n'
git ls-files | rg '(^|/)(rbac|role|clusterrole|deployment|app-server|serviceaccount|manifest|yaml|yml)' || true

printf '\nSearch for relevant permission rules and app-server references:\n'
rg -n --hidden --glob '!.git' \
  -e 'clusterversions' \
  -e 'infrastructures' \
  -e 'operator\.openshift\.io' \
  -e 'console\.operator\.openshift\.io' \
  -e 'app-server' \
  -e 'OLS_ROSA_PRODUCT' \
  -e 'get:\s*$' \
  .

Repository: openshift/lightspeed-operator

Length of output: 11747


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'appserver RBAC generation:\n'
ast-grep outline internal/controller/appserver/assets.go --view expanded || true
printf '\nRelevant slice of internal/controller/appserver/assets.go:\n'
sed -n '1,220p' internal/controller/appserver/assets.go

printf '\nRendered role manifest slice:\n'
sed -n '1,240p' config/rbac/role.yaml

printf '\nCSV permissions slice:\n'
sed -n '700,860p' bundle/manifests/lightspeed-operator.clusterserviceversion.yaml

Repository: openshift/lightspeed-operator

Length of output: 17524


Add get on config.openshift.io/infrastructures to the lookup role. The ROSA variant check reads Infrastructure/cluster, but the current RBAC only grants clusterversions and secret access, so that lookup will be forbidden on ROSA clusters. Mirror the change in the generated manifest/CSV.

🤖 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 @.ai/spec/what/app-server.md around lines 26 - 32, Add the missing RBAC
permission for the ROSA variant lookup: the lookup role currently covers
`clusterversions` and secret access, but `Infrastructure/cluster` requires `get`
on `config.openshift.io/infrastructures`. Update the role used by the app-server
lookup path so the `controlPlaneTopology` read in the ROSA detection flow is
allowed, and mirror the same permission in the generated manifest/CSV. Ensure
the change stays aligned with the `OLS_ROSA_PRODUCT` detection logic that
depends on this lookup.

@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

@blublinsky: 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.

@blublinsky

Copy link
Copy Markdown
Contributor Author

/approve

@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: blublinsky

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 Jul 6, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant