Repository navigation
OSAC-3182: stamp GPU fields from InstanceType onto ComputeInstance CR - #281
Conversation
|
@Tzif-Morgen: This pull request references OSAC-3182 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 task 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughThe change adds optional immutable GPU settings to ChangesGPU configuration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant InstanceType
participant Reconciler
participant ComputeInstanceSpec
InstanceType->>Reconciler: provide resolved GPU settings
Reconciler->>ComputeInstanceSpec: set selector, resource name, and count
ComputeInstanceSpec-->>Reconciler: return generated spec
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
🤖 Review · Commit: |
|
🤖 Review · Commit: |
There was a problem hiding this comment.
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 `@osac-operator/api/v1alpha1/computeinstance_types.go`:
- Around line 159-162: Move the GPU immutability XValidation from GpuSpec to
ComputeInstanceSpec, using a rule that compares both GPU presence and value so
absent-to-present updates are rejected; update
osac-operator/api/v1alpha1/computeinstance_types.go accordingly. Regenerate the
CRD validation in
osac-operator/charts/operator-crds/templates/osac.openshift.io_computeinstances.yaml
lines 124-151 and
osac-operator/config/crd/bases/osac.openshift.io_computeinstances.yaml lines
122-149. Add coverage in
osac-operator/internal/controller/computeinstance_validation_test.go lines
569-585 for rejecting an absent-to-present GPU update.
🪄 Autofix
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: CHILL
Plan: Enterprise
Run ID: e9d825e0-813d-4827-b586-c43175e25a2b
📒 Files selected for processing (8)
fulfillment-service/internal/controllers/computeinstance/computeinstance_reconciler_function.gofulfillment-service/internal/controllers/computeinstance/computeinstance_reconciler_function_test.goosac-operator/api/v1alpha1/computeinstance_types.goosac-operator/api/v1alpha1/computeinstance_types_test.goosac-operator/api/v1alpha1/zz_generated.deepcopy.goosac-operator/charts/operator-crds/templates/osac.openshift.io_computeinstances.yamlosac-operator/config/crd/bases/osac.openshift.io_computeinstances.yamlosac-operator/internal/controller/computeinstance_validation_test.go
Auto-dismissed: only Prow labels gate merging
|
🤖 Finished Review · ✅ Success · Started 8:32 AM UTC · Completed 8:49 AM UTC Commit: |
|
Looks good to me Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsMedium
Low
|
135b6d5 to
47d6254
Compare
|
🤖 Finished Review · ✅ Success · Started 2:46 PM UTC · Completed 3:03 PM UTC Commit: |
Extend addExplicitFields to read GPU data from the resolved InstanceType and set it on the K8s ComputeInstance spec. Add unit tests for GPU present, GPU absent, and idempotency. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Tzif <tmorgens@redhat.com>
47d6254 to
dae45b0
Compare
|
🤖 Finished Review · ✅ Success · Started 6:20 AM UTC · Completed 6:34 AM UTC Commit: |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Tzif-Morgen, ygalblum 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 |
|
/unhold |
9fe819d
OSAC-3182: stamp GPU fields from InstanceType onto ComputeInstance CR
Jira: OSAC-3182
Story type: [DEV]
Depends on: #217 (OSAC-3162 — GpuSpec CRD type)
Summary
Extends the ComputeInstance reconciler's
addExplicitFieldsmethod to read GPU data from the resolved InstanceType and stamp it onto the K8s ComputeInstance CR spec. Follows the same pattern as the existing cores/memory stamping. When the InstanceType has no GPU, the CR's gpu field remains nil.Changes
fulfillment-service/internal/controllers/computeinstance/computeinstance_reconciler_function.goosacv1alpha1.GpuSpecconstruction after cores/memory assignment inaddExplicitFieldsfulfillment-service/internal/controllers/computeinstance/computeinstance_reconciler_function_test.goTesting
buildSpecinterfaceAcceptance Criteria
Summary by CodeRabbit
New Features
Bug Fixes