[AI] OSAC-1927: Resolve tenant storage classes at VM provision when tenant status is empty - #305
Conversation
… status is empty Co-authored-by: Akshay Nadkarni <anadkarn@redhat.com>
|
@osac-jira-ai-issue-solver[bot]: This pull request references OSAC-1927 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 bug 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. |
|
AI Session Costs
|
|
🤖 Finished Review · ✅ Success · Started 7:39 PM UTC · Completed 7:51 PM UTC Commit: |
ReviewFindingsLow
Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsLow
Previous run (3)ReviewFindingsMedium
Low
Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsLow
Previous run (6)ReviewFindingsLow
Previous run (7)ReviewFindingsLow
Previous run (8)ReviewFindingsMedium
Low
Labels: PR adds storage class fallback resolution in the ComputeInstance controller |
Co-authored-by: Akshay Nadkarni <anadkarn@redhat.com>
|
In comment, @fullsend-ai-review[bot] said:
No action needed — workflow status comment. Addressed in 3cab0e4. |
|
In comment, @fullsend-ai-review[bot] said:
Addressed all findings. [error-handling-gap]: Added iteration over resolution.duplicateMessages with r.Recorder.Eventf warning events, matching the pattern in storage_controller.go. [test-adequacy]: Added a fourth test case covering the ambiguous-tier scenario where two StorageClasses share the same tenant+tier labels — verifies the ambiguous tier is excluded from injection. [architectural-coherence]: The existing comment block already documents the fallback intent and relationship to the storage controller; no additional note needed. [scope-alignment]: Acknowledged — the FabricManager string→*string test fixes were necessary compilation fixes. Addressed in 3cab0e4. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: osac-jira-ai-issue-solver[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🤖 Finished Review · ✅ Success · Started 7:58 PM UTC · Completed 8:14 PM UTC Commit: |
Co-authored-by: Akshay Nadkarni <anadkarn@redhat.com>
|
In comment, @fullsend-ai-review[bot] said:
Addressed in 7461750. |
|
In comment, @fullsend-ai-review[bot] said:
Review status notification — no action needed. Addressed in 1e8d4ff. |
|
In comment, @fullsend-ai-review[bot] said:
Review comment pointer — no action needed. Addressed in 1e8d4ff. |
|
🤖 Finished Review · ✅ Success · Started 10:05 PM UTC · Completed 10:22 PM UTC Commit: |
|
In comment, @fullsend-ai-review[bot] said:
I was unable to produce code changes to address this comment after multiple attempts. |
Co-authored-by: Akshay Nadkarni <anadkarn@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 10:33 PM UTC · Completed 10:50 PM UTC Commit: |
|
In comment, @fullsend-ai-review[bot] said:
I was unable to produce code changes to address this comment after multiple attempts. |
|
In comment, @fullsend-ai-review[bot] said:
I was unable to produce code changes to address this comment after multiple attempts. |
Co-authored-by: Akshay Nadkarni <anadkarn@redhat.com>
|
CI failures addressed in 1c7e9c3. |
|
🤖 Finished Review · ✅ Success · Started 11:58 PM UTC · Completed 12:17 AM UTC Commit: |
There was a problem hiding this comment.
Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:
osac-operator/internal/controller/computeinstance_controller.go(file-level): Line 800 · [low] error handling / resilience
The fallback path returns a hard error when getTenantStorageClasses fails, blocking provisioning entirely for transient target-cluster connectivity issues. While this matches the storage_controller.go pattern and controller-runtime retries with backoff, the asymmetry with the primary path (which silently proceeds without storage classes) suggests the fallback could also gracefully degrade.
Suggested fix: Log the error and proceed without storage classes instead of returning a hard error.
osac-operator/internal/controller/computeinstance_controller.go(file-level): Line 800 · [low] error-handling idiom
The fmt.Errorf wrapping at this error return is the only wrapped error in handleUpdate; all six other error returns in this method use raw return ctrl.Result{}, err. This creates an inconsistency within the method.
Suggested fix: Either wrap consistently across handleUpdate error returns or return the raw error to match the dominant pattern.
osac-operator/internal/controller/computeinstance_controller.go(file-level): Line 796 · [low] edge case
When tenant.Status.StorageClasses is a non-nil empty slice (length 0), the code enters the fallback path. The ClusterStorageReady condition guard correctly prevents override when the storage controller has reconciled, making this safe. Noted as a design assumption.
osac-operator/internal/controller/securitygroup_controller_test.go:701: [low] scope-creep
The PR bundles mechanical test fixes for FabricManager string-to-*string type changes in 3 unrelated test files. While harmless and correct, these are not related to OSAC-1927.
Suggested fix: Consider splitting the FabricManager ptr.To() test fixes into a separate commit for auditability.
Resolves OSAC-1927
Summary
Tenant.status.storageClassesis empty (storage controller disabled orAAP jobs failed), the ComputeInstance controller now falls back to resolving
labeled StorageClasses directly from the target cluster using the existing
getTenantStorageClasses()functionstorage controller remains authoritative when enabled
Tenant.status.storageClassesis already populated, behavior isunchanged
Test plan
into provisioning context
classes (AAP reports error)
(regression)
tenant_storage_classestests still passmake lintpasses (0 issues)make testpassesAdditional fixes
Fixed pre-existing test compilation errors in
securitygroup_controller_test.go,subnet_controller_test.go, andvirtualnetwork_controller_test.gowhereFabricManagerfield changed fromstringto*string(proto optional field).