OSAC-3011: add LVMS local storage provider for dev/CI environments - #131
Conversation
|
@zszabo-rh: This pull request references OSAC-3011 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 epic to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zszabo-rh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds LVMS provider automation, tenant StorageClass lifecycle management, local storage registration during installation, and tenant-only StorageClass resolution in the operator. ChangesLVMS storage integration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Installer as LVMS installer
participant Kubernetes as Kubernetes API
participant StorageAPI as Storage API
participant Operator as Storage controller
Installer->>Kubernetes: create LVMS resources and wait for StorageClass
Installer->>StorageAPI: create or retrieve local StorageBackend
StorageAPI-->>Installer: backend ID
Installer->>StorageAPI: create local StorageTier
Operator->>Kubernetes: list tenant-specific StorageClasses
Kubernetes-->>Operator: tenant StorageClasses
Operator->>Operator: resolve tenant tiers without shared fallback
Suggested labels: Suggested reviewers: Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (3 errors, 1 warning)
✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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
`@osac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/tasks/ensure_storage_class.yaml`:
- Around line 19-25: Update the tier.name validation task in
ensure_storage_class.yaml to enforce Kubernetes DNS-compatible StorageClass
names: allow only lowercase alphanumeric characters, hyphens, and dots, with
1–253 characters and alphanumeric characters at both ends. Remove uppercase
letters and underscores from the regex before tier.name is rendered into
StorageClass metadata.name.
In
`@osac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/tasks/teardown_backend.yaml`:
- Around line 18-27: In teardown_backend.yaml lines 18-27, replace the
failed_when: false path so Secret deletion failures preserve their failed state
and are included in the teardown result while retaining the warning. In
teardown_cluster_storage.yaml lines 31-37, make the summary list only
successfully deleted StorageClasses and mark or return teardown failure when any
discovered resource remains. Verify the result propagates through the teardown
dispatcher without hiding failures during target-cluster destruction.
In `@osac-installer/charts/osac/templates/hooks/register-local-storage.yaml`:
- Around line 54-60: Update the HTTP 409 handling in the local StorageBackend
and tier registration flows to fetch both existing resources and validate their
specifications against the requested provider lvms, BACKEND_ID reference, and
protocol 2. Reconcile mismatches where supported; otherwise fail with a clear
error instead of treating the conflict as success, while preserving success for
matching resources.
🪄 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: osac-project/coderabbit/.coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: fa04fdda-4df8-4f30-85da-e1dc5fbbff58
📒 Files selected for processing (13)
osac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/defaults/main.yamlosac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/meta/osac.yamlosac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/tasks/ensure_storage_class.yamlosac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/tasks/setup.yamlosac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/tasks/teardown_backend.yamlosac-aap/collections/ansible_collections/osac/templates/roles/lvms_storage/tasks/teardown_cluster_storage.yamlosac-installer/charts/osac-prereqs/files/hooks/configure-lvms.shosac-installer/charts/osac/templates/hooks/register-local-storage.yamlosac-installer/charts/osac/values.schema.jsonosac-installer/charts/osac/values.yamlosac-operator/internal/controller/storage_controller.goosac-operator/internal/controller/storage_tier_resolution.goosac-operator/internal/controller/tenant_names.go
💤 Files with no reviewable changes (1)
- osac-operator/internal/controller/tenant_names.go
|
E2E test status update Hook, operator detection, and AAP job dispatch are all verified. The full E2E run (StorageBackend → AAP setup action → hub Secret → StorageClass) is blocked by a dependency on #99 (OSAC-1992). Root cause: the monorepo's The E2E test will pass cleanly once #99 merges. The Summary of what is verified on edge-17:
|
4e0736b to
aa9e830
Compare
aa9e830 to
b9d7f48
Compare
The fulfillment service enforces valid tier names at creation time. A second validation layer in the AAP role adds noise without benefit. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
storage_controller_test.go: remove all references to deleted
defaultStorageClassSentinel constant. Update test assertions to match
the new behavior (no Default SC fallback): tests that expected Default
SCs to be resolved now expect empty StorageClasses or use tenant-labeled
SCs instead. Test names updated to describe the new behavior.
register-local-storage.yaml: replace Python f-strings with stderr.write()
calls. The f-string pattern `got: {backends}` inside a Helm YAML
block scalar caused a YAML parse error ("could not find expected ':'")
because the YAML parser misinterpreted {backends} as a flow mapping.
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
Multi-line Python code at zero indentation exits the YAML block scalar context (Helm's YAML parser tries to parse it as regular YAML). Replace multi-line embedded Python with single-line one-liners that stay at the correct indentation within the block scalar. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
The bmaas-ci values file sets lvms.channel (consumed by osac-prereqs Phase 2). The additionalProperties: false on the osac Phase 3 chart schema incorrectly rejected it. Phase 3 only cares about lvms.enabled; other properties belong to Phase 2 and must not be blocked here. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
Two tests in the "Tier resolution" context claimed to prove the old tenant=Default fallback is gone, but neither created a Default-labelled StorageClass — so the regression could re-appear undetected. Add the fixture to each test so the assertions actually cover the removed path. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
Remove reference to `Default` StorageClass. Co-authored-by: Akshay Nadkarni <25892229+akshaynadkarni@users.noreply.github.com>
The GitHub suggestion commits appended new comment text without removing the old lines, producing duplicate comments. Also fixes trailing whitespace and restores tab indentation for struct field comments in Go. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
9c17202 to
e591fe6
Compare
|
/coderabbitai review |
|
@zszabo-rh it looks like the tier isn't passed |
…ation lvms.enabled in osac-prereqs installs the LVMS operator and creates the LVMCluster. The register-local-storage Phase 3 hook previously also checked lvms.enabled, causing it to fire in vmaas-ci (which has lvms.enabled=true for VM disk management) and create an unexpected local StorageBackend there. This broke VMaaS E2E CI: the storage controller detected the StorageBackend, switched from the fallback path to the provisioning path, triggered AAP to create per-tenant StorageClasses, and compute instance tests ran before AAP finished — leaving Status.StorageClasses nil and failing the test. Introduce lvms.registerStorageBackend (default: false) in the osac chart. The register-local-storage hook now checks this flag instead. Set it to true only in edge-17 (OSAC-3234 testing) and leave vmaas-ci unchanged. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
… registration" This reverts commit e161f96.
…testing The register-local-storage hook (gated on lvms.enabled=true) now registers a local StorageBackend + StorageTier in the fulfillment service. The storage controller detects this and triggers AAP jobs to create per-tenant StorageClasses via the lvms_storage role. Without a storage-operations-ig configured in vmaas-ci, those jobs had no instance group to run on and the compute instance test failed with empty tenant_storage_classes. Enable storageFulfillment with STORAGE_TIERS pointing to the local LVMS tier so the storage IG exists and per-tenant StorageClasses are created before compute instance provisioning runs. STORAGE_TIERS here is temporary — will be replaced by osac_job_vars.storage_tier_definitions once OSAC-3013 AAP side lands. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Zoltan Szabo <zszabo@redhat.com>
|
/lgtm |
|
/retest |
|
Re-triggered failed runs:
|
|
/retest |
|
Re-triggered failed runs:
|
Summary
Adds automatic LVMS-based local storage for dev/CI/E2E environments. When
lvms.enabled: true, a post-install Helm hook registers LVMS as a StorageBackend + StorageTier in the fulfillment service. From that point, any tenant onboarded by the operator automatically gets a per-tenant StorageClass via AAP — no manual storage configuration. This replaces thetenant=Defaultshared StorageClass fallback (removed in the operator change).Migrates from the now-archived standalone repos (osac-aap#454, osac-installer#474, osac-operator#397). Those PRs are reviewed and have received conceptual /lgtm — use them as the primary reference for context and design rationale.
What changed from the standalone PRs
osac-aap — architectural simplification
osac.service.storage_providerroutes automatically via theproviderfield in STORAGE_TIERS. Only the new role is needed.local_lvms→lvms— the old name contains an underscore which fails the dispatcher's DNS-label validation regex.lvmsfollows the same pattern asvast(provider: vast→osac.templates.vast_storage).local_lvms_storage→lvms_storage(same reason — dispatcher constructsosac.templates.{{ provider }}_storage)local_lvms_storage_*tolvms_storage_*osac-operator — wider scope than standalone
tenant_names.go(constant),storage_tier_resolution.go(Default SC list query + fallback resolution block),storage_controller.go(Default fallback in AAP path +mapStorageClassToTenantDefault branch +allTenantReconcileRequestshelper)osac-installer — one extra file + SCC fix
lvms:section added to Phase 3 chartvalues.yaml+values.schema.json— it only existed in the Phase 2 prereqs chart previously; both phases must gate on the same flagrunAsUser: 1001removed from the hook's securityContext — the UID falls outside the namespace's SCC-allocated range on OpenShift; let OpenShift assign automatically (matches all other hooks)Dependency
This PR should be rebased on top of OSAC-3547 (#97) (EDA rename:
ansible_eda.event.*→osac_job_vars.*) if that merges first.Test plan
register-local-storagehook fires onlvms.enabled: trueand createsStorageBackendwithprovider: lvms(HTTP 200, verified on edge-17)StorageTier: localcreated andSTORAGE_TIER_STATE_ACTIVEosac-create-tenant-storage-backendAAP job (confirmed in operator logs)lvms_storagerole (AAP project sync issue in test environment, not code-related — same dispatch path asvast_storagewhich is proven)tenant=Defaultfallback removed as designed)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes